mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +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:
@@ -686,7 +686,7 @@ public:
|
||||
bool IsInitialBlockDownload() const;
|
||||
|
||||
/** Find the last common block of this chain and a locator. */
|
||||
CBlockIndex* FindForkInGlobalIndex(const CBlockLocator& locator) const EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
const CBlockIndex* FindForkInGlobalIndex(const CBlockLocator& locator) const EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
/**
|
||||
* Make various assertions about the state of the block index.
|
||||
@@ -829,7 +829,7 @@ private:
|
||||
bool m_snapshot_validated{false};
|
||||
|
||||
CBlockIndex* m_best_invalid;
|
||||
friend bool node::BlockManager::LoadBlockIndex(const Consensus::Params&, ChainstateManager&);
|
||||
friend bool node::BlockManager::LoadBlockIndex(const Consensus::Params&);
|
||||
|
||||
//! Internal helper for ActivateSnapshot().
|
||||
[[nodiscard]] bool PopulateAndValidateSnapshot(
|
||||
|
||||
Reference in New Issue
Block a user