Skip to content

Commit c965241

Browse files
committed
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.
1 parent 73eedaa commit c965241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4122,7 +4122,6 @@ void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
41224122
{
41234123
AssertLockHeld(::cs_main);
41244124
chainman.Unload();
4125-
chainman.pindexBestHeader = nullptr;
41264125
if (mempool) mempool->clear();
41274126
g_versionbitscache.Clear();
41284127
for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {
@@ -5171,6 +5170,7 @@ void ChainstateManager::Unload()
51715170

51725171
m_failed_blocks.clear();
51735172
m_blockman.Unload();
5173+
pindexBestHeader = nullptr;
51745174
m_best_invalid = nullptr;
51755175
}
51765176

0 commit comments

Comments
 (0)