diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-04-01 10:26:54 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-04-01 11:00:42 +0200 |
commit | fa38b1c8bd29e2c792737f6481ab928e46396b7e (patch) | |
tree | ec47db1452c4de5793cac3824e6c9e2e29792313 /src/node | |
parent | 7ab9fc32d6a88d0c9a008d6e63ddc7460e5ea0c5 (diff) |
Remove buggy and confusing IncrementExtraNonce
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/miner.cpp | 18 | ||||
-rw-r--r-- | src/node/miner.h | 2 |
2 files changed, 0 insertions, 20 deletions
diff --git a/src/node/miner.cpp b/src/node/miner.cpp index 917df91933..be5d58527b 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -430,22 +430,4 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda nDescendantsUpdated += UpdatePackagesForAdded(ancestors, mapModifiedTx); } } - -void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce) -{ - // Update nExtraNonce - static uint256 hashPrevBlock; - if (hashPrevBlock != pblock->hashPrevBlock) { - nExtraNonce = 0; - hashPrevBlock = pblock->hashPrevBlock; - } - ++nExtraNonce; - unsigned int nHeight = pindexPrev->nHeight + 1; // Height first in coinbase required for block.version=2 - CMutableTransaction txCoinbase(*pblock->vtx[0]); - txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)); - assert(txCoinbase.vin[0].scriptSig.size() <= 100); - - pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase)); - pblock->hashMerkleRoot = BlockMerkleRoot(*pblock); -} } // namespace node diff --git a/src/node/miner.h b/src/node/miner.h index 5fd9abc280..c8093ec883 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -200,8 +200,6 @@ private: int UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set& mapModifiedTx) EXCLUSIVE_LOCKS_REQUIRED(m_mempool.cs); }; -/** Modify the extranonce in a block */ -void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce); int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev); /** Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed */ |