mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge bitcoin/bitcoin#24515: Only load BlockMan in BlockMan member functions
f865cf8dedAdd and use BlockManager::GetAllBlockIndices (Carl Dong)28ba0313eaAdd and use CBlockIndexHeightOnlyComparator (Carl Dong)12eb05df63move-only: Move CBlockIndexWorkComparator to blockstorage (Carl Dong)c600ee3816Only load BlockMan in BlockMan member functions (Carl Dong)42e56d9b18style-only: No need for std::pair for vSortedByHeight (Carl Dong)3bbb6fea05style-only: Various blockstorage.cpp cleanups (Carl Dong)5be9ee3c54refactor: more const annotations for uses of CBlockIndex* (Anthony Towns) Pull request description: The only important commit is "Only load BlockMan in BlockMan member functions", everything else is all just small style changes. Here's the commit message, reproduced: ``` This commit effectively splits the "load block index itself" logic from "derive Chainstate variables from loaded block index" logic. This means that BlockManager::LoadBlockIndex{,DB} will only load what's relevant to the BlockManager. ``` ACKs for top commit: ajtowns: ACKf865cf8ded; code review only MarcoFalke: review ACKf865cf8ded🗂 Tree-SHA512: 7b204d782834e06fd7329d022e2ae860181b4e8105c33bfb928539a4ec24161dc7438a9c4d4ee279dcad77de310c160b997bb8aa18923243d0fd55ccf4ad7c3a
This commit is contained in:
@@ -50,7 +50,7 @@ void RegenerateCommitments(CBlock& block, ChainstateManager& chainman)
|
||||
tx.vout.erase(tx.vout.begin() + GetWitnessCommitmentIndex(block));
|
||||
block.vtx.at(0) = MakeTransactionRef(tx);
|
||||
|
||||
CBlockIndex* prev_block = WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock));
|
||||
const CBlockIndex* prev_block = WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(block.hashPrevBlock));
|
||||
GenerateCoinbaseCommitment(block, prev_block, Params().GetConsensus());
|
||||
|
||||
block.hashMerkleRoot = BlockMerkleRoot(block);
|
||||
|
||||
Reference in New Issue
Block a user