Browse Source

Ensure pdiff 1 is always caught regardless of bdiff precision, and ceil all other cases to ensure we never lose valid shares

Luke Dashjr 13 years ago
parent
commit
ee9e77f9fe
1 changed files with 3 additions and 2 deletions
  1. 3 2
      miner.c

+ 3 - 2
miner.c

@@ -5923,9 +5923,10 @@ static void set_work_target(struct work *work, double diff)
 
 	d64 = diffone;
 	d64 /= diff;
-	h64 = d64;
+	d64 = ceil(d64);
 
-	if (h64) {
+	if (d64 < 18446744073709551616.0) {
+		h64 = d64;
 		memset(rtarget, 0, 32);
 		data64 = (uint64_t *)(rtarget + 4);
 		*data64 = htobe64(h64);