mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue