mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-26 22:44:21 +00:00
klondike - avoid division by zero if maxcount is unexpectedly zero
This commit is contained in:
parent
b5ea2bf94a
commit
11a36418b2
@ -537,6 +537,7 @@ static int64_t klondike_scanwork(struct thr_info *thr)
|
|||||||
newhashdev += klninfo->status[dev].maxcount; // hash counter wrapped
|
newhashdev += klninfo->status[dev].maxcount; // hash counter wrapped
|
||||||
newhashdev += klninfo->status[dev].hashcount - klninfo->devinfo[dev].lasthashcount;
|
newhashdev += klninfo->status[dev].hashcount - klninfo->devinfo[dev].lasthashcount;
|
||||||
klninfo->devinfo[dev].lasthashcount = klninfo->status[dev].hashcount;
|
klninfo->devinfo[dev].lasthashcount = klninfo->status[dev].hashcount;
|
||||||
|
if (klninfo->status[dev].maxcount != 0)
|
||||||
klninfo->hashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
|
klninfo->hashcount += (newhashdev << 32) / klninfo->status[dev].maxcount;
|
||||||
|
|
||||||
// todo: check stats for critical conditions
|
// todo: check stats for critical conditions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user