Skip to content

Commit e172553

Browse files
committed
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.
1 parent 533eab7 commit e172553

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/validation.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -4790,7 +4790,6 @@ bool ChainstateManager::LoadBlockIndex()
47904790
{
47914791
AssertLockHeld(cs_main);
47924792
// Load block index from databases
4793-
bool needs_init = m_blockman.m_reindexing;
47944793
if (!m_blockman.m_reindexing) {
47954794
bool ret{m_blockman.LoadBlockIndexDB(SnapshotBlockhash())};
47964795
if (!ret) return false;
@@ -4822,18 +4821,6 @@ bool ChainstateManager::LoadBlockIndex()
48224821
if (pindex->IsValid(BLOCK_VALID_TREE) && (m_best_header == nullptr || CBlockIndexWorkComparator()(m_best_header, pindex)))
48234822
m_best_header = pindex;
48244823
}
4825-
4826-
needs_init = m_blockman.m_block_index.empty();
4827-
}
4828-
4829-
if (needs_init) {
4830-
// Everything here is for *new* reindex/DBs. Thus, though
4831-
// LoadBlockIndexDB may have set m_reindexing if we shut down
4832-
// mid-reindex previously, we don't check m_reindexing and
4833-
// instead only check it prior to LoadBlockIndexDB to set
4834-
// needs_init.
4835-
4836-
LogPrintf("Initializing databases...\n");
48374824
}
48384825
return true;
48394826
}

0 commit comments

Comments
 (0)