aboutsummaryrefslogtreecommitdiff
path: root/sha256_via.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha256_via.c')
-rw-r--r--sha256_via.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sha256_via.c b/sha256_via.c
index 186007e..158e757 100644
--- a/sha256_via.c
+++ b/sha256_via.c
@@ -17,7 +17,7 @@ static void via_sha256(void *hash, void *buf, unsigned len)
:"memory");
}
-bool scanhash_via(unsigned char *data_inout,
+bool scanhash_via(int thr_id, unsigned char *data_inout,
const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done)
{
@@ -31,6 +31,8 @@ bool scanhash_via(unsigned char *data_inout,
unsigned long stat_ctr = 0;
int i;
+ work_restart[thr_id].restart = 0;
+
/* bitcoin gives us big endian input, but via wants LE,
* so we reverse the swapping bitcoin has already done (extra work)
* in order to permit the hardware to swap everything
@@ -70,7 +72,7 @@ bool scanhash_via(unsigned char *data_inout,
return true;
}
- if (n >= max_nonce) {
+ if ((n >= max_nonce) || work_restart[thr_id].restart) {
*hashes_done = stat_ctr;
return false;
}