mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
validation: Pass in chainstate to ::PruneBlockFilesManual
This commit is contained in:
parent
4bada76237
commit
63e4c7316a
3 changed files with 5 additions and 4 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue