mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Clear pindexBestHeader in ChainstateManager::Unload()
----- Code Reviewer Notes Call graph of relevant functions: UnloadBlockIndex() <-- Moved from calls ChainstateManager::Unload() <-- Moved to Safe because ChainstateManager::Unload() is called only by UnloadBlockIndex() and no other callers.
This commit is contained in:
parent
73eedaaacc
commit
c96524113c
@ -4122,7 +4122,6 @@ void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
|
||||
{
|
||||
AssertLockHeld(::cs_main);
|
||||
chainman.Unload();
|
||||
chainman.pindexBestHeader = nullptr;
|
||||
if (mempool) mempool->clear();
|
||||
g_versionbitscache.Clear();
|
||||
for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {
|
||||
@ -5171,6 +5170,7 @@ void ChainstateManager::Unload()
|
||||
|
||||
m_failed_blocks.clear();
|
||||
m_blockman.Unload();
|
||||
pindexBestHeader = nullptr;
|
||||
m_best_invalid = nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user