mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02: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:
parent
572d831927
commit
7d99d725cd
4 changed files with 5 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue