From 7c01f1659362048caa5adf73edb96300718a2dd6 Mon Sep 17 00:00:00 2001 From: Denis Ahrens Date: Tue, 11 Dec 2012 23:47:26 +0100 Subject: [PATCH] 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). --- driver-ztex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-ztex.c b/driver-ztex.c index d126580a..2b8d82e8 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