Only increment extranonce2 when needed
This commit is contained in:
parent
cdf82b4090
commit
dd774a337e
1 changed files with 2 additions and 2 deletions
|
@ -664,7 +664,7 @@ static void *miner_thread(void *userdata)
|
||||||
{
|
{
|
||||||
struct thr_info *mythr = userdata;
|
struct thr_info *mythr = userdata;
|
||||||
int thr_id = mythr->id;
|
int thr_id = mythr->id;
|
||||||
struct work work;
|
struct work work = {{0}};
|
||||||
uint32_t max_nonce;
|
uint32_t max_nonce;
|
||||||
uint32_t end_nonce = 0xffffffffU / opt_n_threads * (thr_id + 1) - 0x20;
|
uint32_t end_nonce = 0xffffffffU / opt_n_threads * (thr_id + 1) - 0x20;
|
||||||
unsigned char *scratchbuf = NULL;
|
unsigned char *scratchbuf = NULL;
|
||||||
|
@ -703,7 +703,7 @@ static void *miner_thread(void *userdata)
|
||||||
while (time(NULL) >= g_work_time + 120)
|
while (time(NULL) >= g_work_time + 120)
|
||||||
sleep(1);
|
sleep(1);
|
||||||
pthread_mutex_lock(&g_work_lock);
|
pthread_mutex_lock(&g_work_lock);
|
||||||
if (work.data[19] >= end_nonce)
|
if (work.data[19] >= end_nonce && !memcmp(work.data, g_work.data, 76))
|
||||||
stratum_gen_work(&stratum, &g_work);
|
stratum_gen_work(&stratum, &g_work);
|
||||||
} else {
|
} else {
|
||||||
/* obtain new work from internal workio thread */
|
/* obtain new work from internal workio thread */
|
||||||
|
|
Loading…
Reference in a new issue