From e17255322378076edce3ef6f06cd36ca58d2e236 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Fri, 17 May 2024 18:35:45 +0200 Subject: [PATCH] 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. --- src/validation.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index d398ec74061..3109045521c 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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; }