refactor: Delete ChainstateManager::IsSnapshotValidated() method

IsSnapshotValidated() is only called one place outside of tests, and is use
redundantly in some tests, asserting that a snapshot is not validated when a
snapshot chainstate does not even exist. Simplify by dropping the method and
checking Chainstate m_assumeutxo field directly.
This commit is contained in:
Ryan Ofsky
2024-05-30 16:14:42 -04:00
parent d9e82299fc
commit ee35250683
4 changed files with 4 additions and 15 deletions

View File

@@ -6367,7 +6367,7 @@ void ChainstateManager::RecalculateBestHeader()
bool ChainstateManager::ValidatedSnapshotCleanup(Chainstate& validated_cs, Chainstate& unvalidated_cs)
{
AssertLockHeld(::cs_main);
if (!this->IsSnapshotValidated()) {
if (unvalidated_cs.m_assumeutxo != Assumeutxo::VALIDATED) {
// No need to clean up.
return false;
}