From 0b677407076a55c6a758d1414fade617abd552e5 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 29 Jan 2011 00:56:24 -0500 Subject: Pass max-nonce as arg to each sha256 algo. Should be an equivalent transformation, with no behavior changes. --- sha256_via.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sha256_via.c') diff --git a/sha256_via.c b/sha256_via.c index 6b85e2a..94576a4 100644 --- a/sha256_via.c +++ b/sha256_via.c @@ -17,7 +17,8 @@ static void via_sha256(void *hash, void *buf, unsigned len) :"memory"); } -bool scanhash_via(unsigned char *data_inout, unsigned long *hashes_done) +bool scanhash_via(unsigned char *data_inout, + uint32_t max_nonce, unsigned long *hashes_done) { unsigned char data[128] __attribute__((aligned(128))); unsigned char tmp_hash[32] __attribute__((aligned(128))); @@ -76,7 +77,7 @@ bool scanhash_via(unsigned char *data_inout, unsigned long *hashes_done) return true; } - if ((n & 0xffffff) == 0) { + if (n >= max_nonce) { if (opt_debug) fprintf(stderr, "DBG: end of nonce range\n"); *hashes_done = stat_ctr; -- cgit v1.2.3-18-g5258