File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1391,6 +1391,7 @@ struct pool {
1391
1391
unsigned char * coinbase ;
1392
1392
size_t nonce2_offset ;
1393
1393
unsigned char header_bin [128 ];
1394
+ double next_diff ;
1394
1395
int merkle_offset ;
1395
1396
1396
1397
struct timeval tv_lastwork ;
Original file line number Diff line number Diff line change @@ -1560,6 +1560,7 @@ static bool parse_notify(struct pool *pool, json_t *val)
1560
1560
pool -> swork .nbit = nbit ;
1561
1561
pool -> swork .ntime = ntime ;
1562
1562
pool -> swork .clean = clean ;
1563
+ pool -> swork .diff = pool -> next_diff ;
1563
1564
alloc_len = pool -> swork .cb_len = cb1_len + pool -> n1_len + pool -> n2size + cb2_len ;
1564
1565
pool -> nonce2_offset = cb1_len + pool -> n1_len ;
1565
1566
@@ -1668,8 +1669,8 @@ static bool parse_diff(struct pool *pool, json_t *val)
1668
1669
return false;
1669
1670
1670
1671
cg_wlock (& pool -> data_lock );
1671
- old_diff = pool -> swork . diff ;
1672
- pool -> swork . diff = diff ;
1672
+ old_diff = pool -> next_diff ;
1673
+ pool -> next_diff = diff ;
1673
1674
cg_wunlock (& pool -> data_lock );
1674
1675
1675
1676
if (old_diff != diff ) {
@@ -2560,7 +2561,7 @@ bool initiate_stratum(struct pool *pool)
2560
2561
if (!pool -> stratum_url )
2561
2562
pool -> stratum_url = pool -> sockaddr_url ;
2562
2563
pool -> stratum_active = true;
2563
- pool -> swork .diff = 1 ;
2564
+ pool -> next_diff = pool -> swork .diff = 1 ;
2564
2565
if (opt_protocol ) {
2565
2566
applog (LOG_DEBUG , "%s confirmed mining.subscribe with extranonce1 %s extran2size %d" ,
2566
2567
get_pool_name (pool ), pool -> nonce1 , pool -> n2size );
You can’t perform that action at this time.
0 commit comments