aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp14
-rw-r--r--src/validation.h4
2 files changed, 4 insertions, 14 deletions
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<double>(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<uint256> ChainstateManager::SnapshotBlockhash() const {
if (m_active_chainstate != nullptr) {
// If a snapshot chainstate exists, it will always be our active.
diff --git a/src/validation.h b/src/validation.h
index 53c2dd65e5..12d1d4c91f 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -416,6 +416,10 @@ public:
BlockValidationState& state,
const CChainParams& chainparams,
CBlockIndex** ppindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
+
+ ~BlockManager() {
+ Unload();
+ }
};
/**