diff options
author | Carl Dong <contact@carldong.me> | 2022-02-23 15:22:24 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-04-19 14:34:56 -0400 |
commit | a4014021258319941716d6338c18667462a06280 (patch) | |
tree | 18a979980b0b5b0bad6adf25c4eef588a5944d9a | |
parent | 3308ecd3fc254ee4ef9f803c09f00ba4dc968520 (diff) | |
download | bitcoin-a4014021258319941716d6338c18667462a06280.tar.xz |
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.
-rw-r--r-- | src/node/blockstorage.cpp | 2 | ||||
-rw-r--r-- | src/validation.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index be6a967f7e..f3a1afd9fa 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -300,6 +300,8 @@ void BlockManager::Unload() m_last_blockfile = 0; m_dirty_blockindex.clear(); m_dirty_fileinfo.clear(); + + fHavePruned = false; } bool BlockManager::WriteBlockIndexDB() diff --git a/src/validation.cpp b/src/validation.cpp index b92431afae..c7f9f75a9a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4126,7 +4126,6 @@ void UnloadBlockIndex(CTxMemPool* mempool, ChainstateManager& chainman) for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) { warningcache[b].clear(); } - chainman.m_blockman.fHavePruned = false; } bool ChainstateManager::LoadBlockIndex() |