diff options
author | Carl Dong <contact@carldong.me> | 2021-04-23 15:24:47 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-05-27 13:50:11 -0400 |
commit | e6b4aa6eb53dc555ecab2922af35e7a2572faf4f (patch) | |
tree | 42927d85d5a098a2a333d32cbcc0333eaba78283 /src/miner.h | |
parent | 9ecade14252ad1972f668d2d2e4ef44fdfcb944a (diff) | |
download | bitcoin-e6b4aa6eb53dc555ecab2922af35e7a2572faf4f.tar.xz |
miner: Pass in chainman to RegenerateCommitments
Pass in chainman instead of prev_block so that we can enforce the
block.hashPrevBlock refers to prev_block invariant in the function
itself.
We should probably rethink BlockAssembler's API and somehow include
commitment regeneration functionality in there. Something like a variant
of CreateNewBlock that takes in a std::vector<TxRef> and return a CBlock
instead of CBlockTemplate. That could avoid reaching for
LookupBlockIndex at all.
Diffstat (limited to 'src/miner.h')
-rw-r--r-- | src/miner.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/miner.h b/src/miner.h index becf362b79..10a80f4392 100644 --- a/src/miner.h +++ b/src/miner.h @@ -203,6 +203,6 @@ void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev); /** Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed */ -void RegenerateCommitments(CBlock& block, CBlockIndex* prev_block); +void RegenerateCommitments(CBlock& block, ChainstateManager& chainman); #endif // BITCOIN_MINER_H |