Browse Source

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.
nfactor-troky
Con Kolivas 14 years ago
parent
commit
da06a348d0
  1. 4
      main.c

4
main.c

@ -2715,7 +2715,9 @@ static void *miner_thread(void *userdata) @@ -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;

Loading…
Cancel
Save