validation: remove LoadChainTip call from ActivateSnapshot
What changed, and why it matters
This commit removes a redundant function call and its assertion from the snapshot activation code in Bitcoin Core. The commit message explains the call was doing nothing useful because an earlier step already set the same state. There is no security-relevant change visible in the diff or commit message.
No security action needed. Treat as routine code cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In ChainstateManager::ActivateSnapshot(), the code previously called chainstate.LoadChainTip() and asserted it returned true. The commit removes both lines because PopulateAndValidateSnapshot() already sets the chain tip and the coins cache best block to the snapshot block, making LoadChainTip() hit its early-return path every time. The change is a pure cleanup of dead/unnecessary code.
Changed components
src/validation.cppChainstateManager::ActivateSnapshot()assumeutxo snapshot activationInspect captured patch +0 / −2
diff --git a/src/validation.cpp b/src/validation.cpp
index 1285edc2..3ed46c1a 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -5741,8 +5741,6 @@ util::Result<CBlockIndex*> ChainstateManager::ActivateSnapshot(
}
Chainstate& chainstate{AddChainstate(std::move(snapshot_chainstate))};
- const bool chaintip_loaded{chainstate.LoadChainTip()};
- assert(chaintip_loaded);
m_blockman.m_snapshot_height = Assert(chainstate.SnapshotBase())->nHeight;
LogInfo("[snapshot] successfully activated snapshot %s", base_blockhash.ToString());
Why this scored 13/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.