aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-09-15 15:59:46 -0400
committerCarl Dong <contact@carldong.me>2021-03-01 17:56:07 -0500
commit63e4c7316a537900f525e221d8042587b443cc3d (patch)
treefd7a4e43848b6126e7860a21dd2f5e877a3cdf46 /src/validation.cpp
parent4bada76237d734c1de38d3bd58689caeefd5e8cb (diff)
validation: Pass in chainstate to ::PruneBlockFilesManual
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index f7faa12458..95fb3f6864 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3953,11 +3953,12 @@ void BlockManager::FindFilesToPruneManual(std::set<int>& setFilesToPrune, int nM
}
/* This function is called from the RPC code for pruneblockchain */
-void PruneBlockFilesManual(int nManualPruneHeight)
+void PruneBlockFilesManual(CChainState& active_chainstate, int nManualPruneHeight)
{
BlockValidationState state;
const CChainParams& chainparams = Params();
- if (!::ChainstateActive().FlushStateToDisk(
+ assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
+ if (!active_chainstate.FlushStateToDisk(
chainparams, state, FlushStateMode::NONE, nManualPruneHeight)) {
LogPrintf("%s: failed to flush state (%s)\n", __func__, state.ToString());
}