Browse Source

Bugfix: Check last solo generation tx against new template rather than most recent

Luke Dashjr 11 years ago
parent
commit
fc627f8592
1 changed files with 2 additions and 1 deletions
  1. 2 1
      miner.c

+ 2 - 1
miner.c

@@ -2975,7 +2975,8 @@ static bool work_decode(struct pool *pool, struct work *work, json_t *val)
 		}
 		}
 		work->rolltime = blkmk_time_left(tmpl, tv_now.tv_sec);
 		work->rolltime = blkmk_time_left(tmpl, tv_now.tv_sec);
 #if BLKMAKER_VERSION > 1
 #if BLKMAKER_VERSION > 1
-		if ((!tmpl->cbtxn) && coinbase_script_block_id != current_block_id)
+		const uint32_t tmpl_block_id = ((uint32_t*)tmpl->prevblk)[0];
+		if ((!tmpl->cbtxn) && coinbase_script_block_id != tmpl_block_id)
 			refresh_bitcoind_address(false);
 			refresh_bitcoind_address(false);
 		if (bytes_len(&opt_coinbase_script))
 		if (bytes_len(&opt_coinbase_script))
 		{
 		{