mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 11:43:26 -03:00
validation: Load pindexBestHeader in ChainMan
Now BlockManager::LoadBlockIndex() will ACTUALLY only load BlockMan members. [META] In a later commit, pindexBestHeader will be moved to ChainMan as a member ----- Code Reviewer Notes Call graph of relevant functions: ChainstateManager::LoadBlockIndex() <-- Moved to calls BlockManager::LoadBlockIndexDB() which calls BlockManager::LoadBlockIndex() <-- Moved from There is only one call to each of inner functions, meaning that no behavior is changing.
This commit is contained in:
parent
2b5a741e98
commit
5d670173a3
2 changed files with 2 additions and 2 deletions
|
@ -285,8 +285,6 @@ bool BlockManager::LoadBlockIndex(const Consensus::Params& consensus_params)
|
||||||
if (pindex->pprev) {
|
if (pindex->pprev) {
|
||||||
pindex->BuildSkip();
|
pindex->BuildSkip();
|
||||||
}
|
}
|
||||||
if (pindex->IsValid(BLOCK_VALID_TREE) && (pindexBestHeader == nullptr || CBlockIndexWorkComparator()(pindexBestHeader, pindex)))
|
|
||||||
pindexBestHeader = pindex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -4203,6 +4203,8 @@ bool ChainstateManager::LoadBlockIndex()
|
||||||
if (pindex->nStatus & BLOCK_FAILED_MASK && (!m_best_invalid || pindex->nChainWork > m_best_invalid->nChainWork)) {
|
if (pindex->nStatus & BLOCK_FAILED_MASK && (!m_best_invalid || pindex->nChainWork > m_best_invalid->nChainWork)) {
|
||||||
m_best_invalid = pindex;
|
m_best_invalid = pindex;
|
||||||
}
|
}
|
||||||
|
if (pindex->IsValid(BLOCK_VALID_TREE) && (pindexBestHeader == nullptr || CBlockIndexWorkComparator()(pindexBestHeader, pindex)))
|
||||||
|
pindexBestHeader = pindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
needs_init = m_blockman.m_block_index.empty();
|
needs_init = m_blockman.m_block_index.empty();
|
||||||
|
|
Loading…
Add table
Reference in a new issue