320@@ -320,10 +321,13 @@ void BlockManager::FindFilesToPrune(
321 // On a prune event, the chainstate DB is flushed.
322 // To avoid excessive prune events negating the benefit of high dbcache
323 // values, we should not prune too rapidly.
324- // So when pruning in IBD, increase the buffer a bit to avoid a re-prune too soon.
325- if (chainman.IsInitialBlockDownload()) {
326- // Since this is only relevant during IBD, we use a fixed 10%
327- nBuffer += target / 10;
328+ // So when pruning in IBD, increase the buffer to avoid a re-prune too soon.
329+ const auto chain_tip_height = chain.m_chain.Height();
nit: could remove the cast in the next line with
0 const uint64_t chain_tip_height = chain.m_chain.Height();