1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-14 16:58:05 +00:00

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).
This commit is contained in:
Denis Ahrens 2012-12-11 23:47:26 +01:00
parent d3aed9fe90
commit 7c01f16593

View File

@ -282,7 +282,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
#endif #endif
if (nonce > noncecnt) if (nonce > noncecnt)
noncecnt = nonce; 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]); applog(LOG_DEBUG, "%s: overflow nonce=%0.8x lastnonce=%0.8x", ztex->repr, nonce, lastnonce[i]);
overflow = true; overflow = true;
} else } else