1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 13:04:29 +00:00

The max_nonce wasn't being reset on starting new work making cpu mining fail on each new work item.

This commit is contained in:
Con Kolivas 2011-07-14 17:43:16 +10:00
parent 3d900e7bc2
commit fe8ab94a92

3
main.c
View File

@ -1318,6 +1318,7 @@ static void *miner_thread(void *userdata)
struct thr_info *mythr = userdata; struct thr_info *mythr = userdata;
const int thr_id = mythr->id; const int thr_id = mythr->id;
uint32_t max_nonce = 0xffffff; uint32_t max_nonce = 0xffffff;
unsigned long hashes_done = max_nonce;
bool needs_work = true; bool needs_work = true;
/* Try to cycle approximately 5 times before each log update */ /* Try to cycle approximately 5 times before each log update */
const unsigned long cycle = opt_log_interval / 5 ? : 1; const unsigned long cycle = opt_log_interval / 5 ? : 1;
@ -1341,7 +1342,6 @@ static void *miner_thread(void *userdata)
while (1) { while (1) {
struct work work __attribute__((aligned(128))); struct work work __attribute__((aligned(128)));
unsigned long hashes_done;
struct timeval tv_workstart, tv_start, tv_end, diff; struct timeval tv_workstart, tv_start, tv_end, diff;
uint64_t max64; uint64_t max64;
bool rc; bool rc;
@ -1358,6 +1358,7 @@ static void *miner_thread(void *userdata)
work.thr_id = thr_id; work.thr_id = thr_id;
needs_work = requested = false; needs_work = requested = false;
work.blk.nonce = 0; work.blk.nonce = 0;
max_nonce = hashes_done;
} }
hashes_done = 0; hashes_done = 0;
gettimeofday(&tv_start, NULL); gettimeofday(&tv_start, NULL);