Commit 0c499352503e28344c5586f014e8e538b36ea770

Con Kolivas 2011-07-18T11:05:37

Fix CPU mining with other algorithms not working.

diff --git a/sha256_cryptopp.c b/sha256_cryptopp.c
index 0abf36e..5a9f00b 100644
--- a/sha256_cryptopp.c
+++ b/sha256_cryptopp.c
@@ -116,12 +116,12 @@ bool scanhash_cryptopp(int thr_id, const unsigned char *midstate,
 		stat_ctr++;
 
 		if (unlikely((hash32[7] == 0) && fulltest(hash, target))) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return true;
 		}
 
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return false;
 		}
 	}
diff --git a/sha256_generic.c b/sha256_generic.c
index 683e069..5bc4d97 100644
--- a/sha256_generic.c
+++ b/sha256_generic.c
@@ -261,12 +261,12 @@ bool scanhash_c(int thr_id, const unsigned char *midstate, unsigned char *data,
 		stat_ctr++;
 
 		if (unlikely((hash32[7] == 0) && fulltest(hash, target))) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return true;
 		}
 
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return false;
 		}
 	}
diff --git a/sha256_via.c b/sha256_via.c
index f12e447..fdf0045 100644
--- a/sha256_via.c
+++ b/sha256_via.c
@@ -70,12 +70,12 @@ bool scanhash_via(int thr_id, unsigned char *data_inout,
 				dout32[i] = swab32(data32[i]);
 			}
 
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return true;
 		}
 
 		if ((n >= max_nonce) || work_restart[thr_id].restart) {
-			*hashes_done = stat_ctr;
+			*hashes_done = n;
 			return false;
 		}
 	}