Browse Source

Fix CPU mining with other algorithms not working.

Con Kolivas 14 years ago
parent
commit
0c49935250
3 changed files with 6 additions and 6 deletions
  1. 2 2
      sha256_cryptopp.c
  2. 2 2
      sha256_generic.c
  3. 2 2
      sha256_via.c

+ 2 - 2
sha256_cryptopp.c

@@ -116,12 +116,12 @@ bool scanhash_cryptopp(int thr_id, const unsigned char *midstate,
 		stat_ctr++;
 		stat_ctr++;
 
 
 		if (unlikely((hash32[7] == 0) && fulltest(hash, target))) {
 		if (unlikely((hash32[7] == 0) && fulltest(hash, target))) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return true;
 			return true;
 		}
 		}
 
 
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return false;
 			return false;
 		}
 		}
 	}
 	}

+ 2 - 2
sha256_generic.c

@@ -261,12 +261,12 @@ bool scanhash_c(int thr_id, const unsigned char *midstate, unsigned char *data,
 		stat_ctr++;
 		stat_ctr++;
 
 
 		if (unlikely((hash32[7] == 0) && fulltest(hash, target))) {
 		if (unlikely((hash32[7] == 0) && fulltest(hash, target))) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return true;
 			return true;
 		}
 		}
 
 
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return false;
 			return false;
 		}
 		}
 	}
 	}

+ 2 - 2
sha256_via.c

@@ -70,12 +70,12 @@ bool scanhash_via(int thr_id, unsigned char *data_inout,
 				dout32[i] = swab32(data32[i]);
 				dout32[i] = swab32(data32[i]);
 			}
 			}
 
 
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return true;
 			return true;
 		}
 		}
 
 
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return false;
 			return false;
 		}
 		}
 	}
 	}