Browse Source

share_diff needs to be performed on a BE version of the output hash to work, leading to false best_share values as spotted by luke-Jr.

Con Kolivas 13 years ago
parent
commit
34879487fc
1 changed files with 3 additions and 4 deletions
  1. 3 4
      cgminer.c

+ 3 - 4
cgminer.c

@@ -5133,10 +5133,9 @@ static bool hashtest(struct thr_info *thr, struct work *work)
 
 	flip80(swap32, data32);
 	sha2(swap, 80, hash1);
-	sha2(hash1, 32, hash2);
-	flip32(work->hash, hash2_32);
+	sha2(hash1, 32, work->hash);
+	flip32(hash2_32, work->hash);
 
-	/* Flipped or not, hash2_32[7] should be 0 */
 	if (hash2_32[7] != 0) {
 		applog(LOG_WARNING, "%s%d: invalid nonce - HW error",
 				thr->cgpu->api->name, thr->cgpu->device_id);
@@ -5152,7 +5151,7 @@ static bool hashtest(struct thr_info *thr, struct work *work)
 		goto out;
 	}
 
-	ret = fulltest(work->hash, work->target);
+	ret = fulltest(hash2, work->target);
 	if (!ret) {
 		applog(LOG_INFO, "Share below target");
 		/* Check the diff of the share, even if it didn't reach the