From 7b8eb397894a052d3bf8e3b6ca8c7e2d97e6ede2 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 3 Sep 2018 12:31:42 +0300 Subject: [PATCH] Erase mnListCache entry on UndoBlock --- src/evo/deterministicmns.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/evo/deterministicmns.cpp b/src/evo/deterministicmns.cpp index dc15d7fa59197..6cc2312157a9f 100644 --- a/src/evo/deterministicmns.cpp +++ b/src/evo/deterministicmns.cpp @@ -328,9 +328,11 @@ bool CDeterministicMNManager::UndoBlock(const CBlock& block, const CBlockIndex* LOCK(cs); int nHeight = pindex->nHeight; + uint256 blockHash = block.GetHash(); - evoDb.Erase(std::make_pair(DB_LIST_DIFF, block.GetHash())); - evoDb.Erase(std::make_pair(DB_LIST_SNAPSHOT, block.GetHash())); + evoDb.Erase(std::make_pair(DB_LIST_DIFF, blockHash)); + evoDb.Erase(std::make_pair(DB_LIST_SNAPSHOT, blockHash)); + mnListsCache.erase(blockHash); if (nHeight == GetSpork15Value()) { LogPrintf("CDeterministicMNManager::%s -- spork15 is not active anymore. nHeight=%d\n", __func__, nHeight);