From 6848561bd4d5863d9ae5af76df1bc3d3fc57a764 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 18 Jan 2016 22:06:34 -0800 Subject: [PATCH] Remove extra nonce reset logic in IncrementExtraNonce I assume this was added to prevent deanonymization, but that doesn't matter anymore since its only used on regtest. --- src/miner.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 9575858840..b4e36b8219 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -589,13 +589,7 @@ void BlockAssembler::addPriorityTxs() void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce) { - // Update nExtraNonce - static uint256 hashPrevBlock; - if (hashPrevBlock != pblock->hashPrevBlock) - { - nExtraNonce = 0; - hashPrevBlock = pblock->hashPrevBlock; - } + assert(pblock->hashPrevBlock == pindexPrev->GetBlockHash()); ++nExtraNonce; unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2 CMutableTransaction txCoinbase(pblock->vtx[0]);