Commit 7c01f1659362048caa5adf73edb96300718a2dd6

Denis Ahrens 2012-12-11T23:47:26

driver-ztex: search the complete noncerange based on the actual speed search the complete noncerange until the range to the end is more work than at the last round. doing one more round would mean we would have a overrun, which is a waste. with actual ztex boards this means that a new getwork is needed every 19 seconds in general and not every 10 seconds (without rollntime).

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/driver-ztex.c b/driver-ztex.c
index d126580..2b8d82e 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -282,7 +282,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 #endif
 			if (nonce > noncecnt)
 				noncecnt = nonce;
-			if (((nonce & 0x7fffffff) >> 4) < ((lastnonce[i] & 0x7fffffff) >> 4)) {
+			if (((0xffffffff - nonce) < (nonce - lastnonce[i])) || nonce < lastnonce[i]) {
 				applog(LOG_DEBUG, "%s: overflow nonce=%0.8x lastnonce=%0.8x", ztex->repr, nonce, lastnonce[i]);
 				overflow = true;
 			} else