Skip to content

Commit a401402

Browse files
committed
Clear fHavePruned in BlockManager::Unload()
----- Code Reviewer Notes Call graph of relevant functions: UnloadBlockIndex() <-- Moved from calls ChainstateManager::Unload() which calls BlockManager::Unload() <-- Moved to So calling UnloadBlockIndex() would still run this moved code. The code will also now run when ~BlockManager gets called, which makes sense.
1 parent 3308ecd commit a401402

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/node/blockstorage.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ void BlockManager::Unload()
300300
m_last_blockfile = 0;
301301
m_dirty_blockindex.clear();
302302
m_dirty_fileinfo.clear();
303+
304+
fHavePruned = false;
303305
}
304306

305307
bool BlockManager::WriteBlockIndexDB()

src/validation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4126,7 +4126,6 @@ void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman)
41264126
for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {
41274127
warningcache[b].clear();
41284128
}
4129-
chainman.m_blockman.fHavePruned = false;
41304129
}
41314130

41324131
bool ChainstateManager::LoadBlockIndex()

0 commit comments

Comments
 (0)