From da06a348d084f81f85676bc190966e2d26c102d5 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 28 Jul 2011 10:03:31 +1000 Subject: [PATCH] The work length in the miner thread gets smaller but doesn't get bigger if it's under 1 second. This could end up leading to CPU under-utilisation and lower and lower hash rates. Fix it by increasing work length if it drops under 1 second. --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 9dc3c1fc..7c92cdf1 100644 --- a/main.c +++ b/main.c @@ -2715,7 +2715,9 @@ static void *miner_thread(void *userdata) if (diff.tv_sec && diff.tv_sec != cycle) { max64 = work.blk.nonce + ((uint64_t)hashes_done * cycle) / diff.tv_sec; - } else + } else if (!diff.tv_sec) + max64 = work.blk.nonce + (hashes_done * 2); + else max64 = work.blk.nonce + hashes_done; if (max64 > 0xfffffffaULL) max64 = 0xfffffffaULL;