Skip to content

Commit ae9ceed

Browse files
jonatackvasildlaanwj
committed
validation, refactoring: remove ChainstateManager::Reset()
Co-authored-by: Vasil Dimov <[email protected]> Co-authored-by: laanwj <[email protected]>
1 parent daad009 commit ae9ceed

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

src/test/util/setup_common.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ ChainTestingSetup::~ChainTestingSetup()
183183
WITH_LOCK(::cs_main, UnloadBlockIndex(m_node.mempool.get(), *m_node.chainman));
184184
m_node.mempool.reset();
185185
m_node.scheduler.reset();
186-
m_node.chainman->Reset();
187186
m_node.chainman.reset();
188187
}
189188

src/validation.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5009,15 +5009,6 @@ void ChainstateManager::Unload()
50095009
m_best_invalid = nullptr;
50105010
}
50115011

5012-
void ChainstateManager::Reset()
5013-
{
5014-
LOCK(::cs_main);
5015-
m_ibd_chainstate.reset();
5016-
m_snapshot_chainstate.reset();
5017-
m_active_chainstate = nullptr;
5018-
m_snapshot_validated = false;
5019-
}
5020-
50215012
void ChainstateManager::MaybeRebalanceCaches()
50225013
{
50235014
if (m_ibd_chainstate && !m_snapshot_chainstate) {

src/validation.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -985,17 +985,13 @@ class ChainstateManager
985985
//! Unload block index and chain data before shutdown.
986986
void Unload() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
987987

988-
//! Clear (deconstruct) chainstate data.
989-
void Reset();
990-
991988
//! Check to see if caches are out of balance and if so, call
992989
//! ResizeCoinsCaches() as needed.
993990
void MaybeRebalanceCaches() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
994991

995992
~ChainstateManager() {
996993
LOCK(::cs_main);
997-
UnloadBlockIndex(/* mempool */ nullptr, *this);
998-
Reset();
994+
UnloadBlockIndex(/*mempool=*/nullptr, *this);
999995
}
1000996
};
1001997

0 commit comments

Comments
 (0)