1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 10:04:33 +00:00

Sanity check for absurd target setting and divide by zero.

This commit is contained in:
Con Kolivas 2013-11-02 11:20:26 +11:00
parent 21bdcdd6b3
commit 876a83024d

View File

@ -3114,6 +3114,8 @@ static void calc_diff(struct work *work, double known)
if (opt_scrypt)
d64 *= (double)65536;
dcut64 = le256todouble(work->target);
if (unlikely(!dcut64))
dcut64 = 1;
work->work_difficulty = d64 / dcut64;
}
difficulty = work->work_difficulty;