Browse Source

Bugfix: cpu: Increment nonce after checking (rather than before), to avoid skipping the first nonce of each scanhash call

Luke Dashjr 13 years ago
parent
commit
24f06e20f5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      sha256_cryptopp.c

+ 2 - 1
sha256_cryptopp.c

@@ -593,7 +593,6 @@ bool scanhash_asm32(int thr_id, const unsigned char *midstate,
 	work_restart[thr_id].restart = 0;
 	work_restart[thr_id].restart = 0;
 
 
 	while (1) {
 	while (1) {
-		n++;
 		*nonce = n;
 		*nonce = n;
 
 
 		runhash32(hash1, data, midstate);
 		runhash32(hash1, data, midstate);
@@ -608,6 +607,8 @@ bool scanhash_asm32(int thr_id, const unsigned char *midstate,
 			*last_nonce = n;
 			*last_nonce = n;
 			return false;
 			return false;
 		}
 		}
+
+		++n;
 	}
 	}
 }
 }