mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
validation, refactoring: remove ChainstateManager::Reset()
Co-authored-by: Vasil Dimov <vd@FreeBSD.org> Co-authored-by: laanwj <126646+laanwj@users.noreply.github.com>
This commit is contained in:
parent
daad0093e3
commit
ae9ceed3e2
3 changed files with 1 additions and 15 deletions
|
@ -183,7 +183,6 @@ ChainTestingSetup::~ChainTestingSetup()
|
|||
WITH_LOCK(::cs_main, UnloadBlockIndex(m_node.mempool.get(), *m_node.chainman));
|
||||
m_node.mempool.reset();
|
||||
m_node.scheduler.reset();
|
||||
m_node.chainman->Reset();
|
||||
m_node.chainman.reset();
|
||||
}
|
||||
|
||||
|
|
|
@ -5009,15 +5009,6 @@ void ChainstateManager::Unload()
|
|||
m_best_invalid = nullptr;
|
||||
}
|
||||
|
||||
void ChainstateManager::Reset()
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
m_ibd_chainstate.reset();
|
||||
m_snapshot_chainstate.reset();
|
||||
m_active_chainstate = nullptr;
|
||||
m_snapshot_validated = false;
|
||||
}
|
||||
|
||||
void ChainstateManager::MaybeRebalanceCaches()
|
||||
{
|
||||
if (m_ibd_chainstate && !m_snapshot_chainstate) {
|
||||
|
|
|
@ -985,17 +985,13 @@ public:
|
|||
//! Unload block index and chain data before shutdown.
|
||||
void Unload() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
|
||||
//! Clear (deconstruct) chainstate data.
|
||||
void Reset();
|
||||
|
||||
//! Check to see if caches are out of balance and if so, call
|
||||
//! ResizeCoinsCaches() as needed.
|
||||
void MaybeRebalanceCaches() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
|
||||
~ChainstateManager() {
|
||||
LOCK(::cs_main);
|
||||
UnloadBlockIndex(/* mempool */ nullptr, *this);
|
||||
Reset();
|
||||
UnloadBlockIndex(/*mempool=*/nullptr, *this);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue