diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-07-01 09:58:06 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-07-15 13:52:41 +0200 |
commit | fa27f03b4943540aa2eab283d4cf50ad4a1a01f8 (patch) | |
tree | fa20dcc35b6801c7364eb9a0c81e1112de35a692 /src/validation.cpp | |
parent | c0224bc96287b04c9ac4d2ae93621c72be5c2baf (diff) | |
download | bitcoin-fa27f03b4943540aa2eab283d4cf50ad4a1a01f8.tar.xz |
Move LoadBlockIndexDB to BlockManager
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 26333d7026..6c70fc686b 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3764,10 +3764,10 @@ void BlockManager::Unload() { m_block_index.clear(); } -bool CChainState::LoadBlockIndexDB() +bool BlockManager::LoadBlockIndexDB(std::set<CBlockIndex*, CBlockIndexWorkComparator>& setBlockIndexCandidates) { - if (!m_blockman.LoadBlockIndex( - m_params.GetConsensus(), *pblocktree, + if (!LoadBlockIndex( + ::Params().GetConsensus(), *pblocktree, setBlockIndexCandidates)) { return false; } @@ -3792,7 +3792,7 @@ bool CChainState::LoadBlockIndexDB() // Check presence of blk files LogPrintf("Checking all blk files are present...\n"); std::set<int> setBlkDataFiles; - for (const std::pair<const uint256, CBlockIndex*>& item : m_blockman.m_block_index) { + for (const std::pair<const uint256, CBlockIndex*>& item : m_block_index) { CBlockIndex* pindex = item.second; if (pindex->nStatus & BLOCK_HAVE_DATA) { setBlkDataFiles.insert(pindex->nFile); @@ -4114,7 +4114,7 @@ bool ChainstateManager::LoadBlockIndex() // Load block index from databases bool needs_init = fReindex; if (!fReindex) { - bool ret = ActiveChainstate().LoadBlockIndexDB(); + bool ret = m_blockman.LoadBlockIndexDB(ActiveChainstate().setBlockIndexCandidates); if (!ret) return false; needs_init = m_blockman.m_block_index.empty(); } |