mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-12 16:45:40 +01:00
Index: Use prune locks for blockfilterindex
Prior to this change blocks could be pruned up to the last block before the blockfilterindex current best block.
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
#include <deploymentstatus.h>
|
||||
#include <flatfile.h>
|
||||
#include <hash.h>
|
||||
#include <index/blockfilterindex.h>
|
||||
#include <logging.h>
|
||||
#include <logging/timer.h>
|
||||
#include <node/blockstorage.h>
|
||||
@@ -2349,10 +2348,6 @@ bool CChainState::FlushStateToDisk(
|
||||
int last_prune{m_chain.Height()}; // last height we can prune
|
||||
std::optional<std::string> limiting_lock; // prune lock that actually was the limiting factor, only used for logging
|
||||
|
||||
ForEachBlockFilterIndex([&](BlockFilterIndex& index) {
|
||||
last_prune = std::max(1, std::min(last_prune, index.GetSummary().best_block_height));
|
||||
});
|
||||
|
||||
for (const auto& prune_lock : m_blockman.m_prune_locks) {
|
||||
if (prune_lock.second.height_first == std::numeric_limits<int>::max()) continue;
|
||||
// Remove the buffer and one additional block here to get actual height that is outside of the buffer
|
||||
|
||||
Reference in New Issue
Block a user