mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
validation: Remove needs_init from LoadBlockIndex
It does not control any actual logic and the log message as well as the comment are obsolete, since no database initialization takes place there anymore. Log messages indicating when indexes and chainstate databases are loaded exist in other places.
This commit is contained in:
parent
533eab7d67
commit
e172553223
@ -4790,7 +4790,6 @@ bool ChainstateManager::LoadBlockIndex()
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
// Load block index from databases
|
||||
bool needs_init = m_blockman.m_reindexing;
|
||||
if (!m_blockman.m_reindexing) {
|
||||
bool ret{m_blockman.LoadBlockIndexDB(SnapshotBlockhash())};
|
||||
if (!ret) return false;
|
||||
@ -4822,18 +4821,6 @@ bool ChainstateManager::LoadBlockIndex()
|
||||
if (pindex->IsValid(BLOCK_VALID_TREE) && (m_best_header == nullptr || CBlockIndexWorkComparator()(m_best_header, pindex)))
|
||||
m_best_header = pindex;
|
||||
}
|
||||
|
||||
needs_init = m_blockman.m_block_index.empty();
|
||||
}
|
||||
|
||||
if (needs_init) {
|
||||
// Everything here is for *new* reindex/DBs. Thus, though
|
||||
// LoadBlockIndexDB may have set m_reindexing if we shut down
|
||||
// mid-reindex previously, we don't check m_reindexing and
|
||||
// instead only check it prior to LoadBlockIndexDB to set
|
||||
// needs_init.
|
||||
|
||||
LogPrintf("Initializing databases...\n");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user