diff --git a/cgminer.c b/cgminer.c index 2ea0d1f7..76bfcc2b 100644 --- a/cgminer.c +++ b/cgminer.c @@ -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;