Fix CPU mining with other algorithms not working.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
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;
}
}