Only load BlockMan in BlockMan member functions

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.

I strongly recommend reviewing with the following git-diff flags:
  --color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change
This commit is contained in:
Carl Dong
2022-03-07 21:42:27 -05:00
parent 42e56d9b18
commit c600ee3816
4 changed files with 80 additions and 68 deletions

View File

@@ -836,7 +836,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(