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