From 4668ded6d6ea4299d998abbb57543f37519812e2 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 8 Sep 2020 14:36:31 -0400 Subject: validation: Move ~CMainCleanup logic to ~BlockManager ~CMainCleanup: 1. Is vestigial 2. References the g_chainman global (we should minimize g_chainman refs) 3. Only acts on g_chainman.m_blockman 4. Does the same thing as BlockManager::Unload --- src/validation.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index bdbae66511..5beff88a01 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5226,20 +5226,6 @@ double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pin return std::min(pindex->nChainTx / fTxTotal, 1.0); } -class CMainCleanup -{ -public: - CMainCleanup() {} - ~CMainCleanup() { - // block headers - BlockMap::iterator it1 = g_chainman.BlockIndex().begin(); - for (; it1 != g_chainman.BlockIndex().end(); it1++) - delete (*it1).second; - g_chainman.BlockIndex().clear(); - } -}; -static CMainCleanup instance_of_cmaincleanup; - Optional ChainstateManager::SnapshotBlockhash() const { if (m_active_chainstate != nullptr) { // If a snapshot chainstate exists, it will always be our active. -- cgit v1.2.3