mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
validation: No mempool clearing in UnloadBlockIndex
The only caller that uses this is ~ChainTestingSetup() where we immediately destroy the mempool afterwards.
This commit is contained in:
@@ -4146,11 +4146,10 @@ void CChainState::UnloadBlockIndex()
|
||||
// May NOT be used after any connections are up as much
|
||||
// of the peer-processing logic assumes a consistent
|
||||
// block index state
|
||||
void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
|
||||
void UnloadBlockIndex(ChainstateManager& chainman)
|
||||
{
|
||||
AssertLockHeld(::cs_main);
|
||||
chainman.Unload();
|
||||
if (mempool) mempool->clear();
|
||||
}
|
||||
|
||||
bool ChainstateManager::LoadBlockIndex()
|
||||
@@ -5231,7 +5230,7 @@ void ChainstateManager::MaybeRebalanceCaches()
|
||||
ChainstateManager::~ChainstateManager()
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
UnloadBlockIndex(/*mempool=*/nullptr, *this);
|
||||
UnloadBlockIndex(*this);
|
||||
|
||||
// TODO: The version bits cache and warning cache should probably become
|
||||
// non-globals
|
||||
|
||||
Reference in New Issue
Block a user