@@ -2281,52 +2281,13 @@ bool CChainState::FlushStateToDisk(
2281
2281
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState (&m_mempool);
2282
2282
LOCK (cs_LastBlockFile);
2283
2283
if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0 ) && !fReindex ) {
2284
- // Previously, we called the global function ::ChainActive() in
2285
- // FindFilesToPrune{,Manual} to get the tip height and to determine
2286
- // whether or not a tip even exists. Now, we are simply passing in
2287
- // m_chain.Height() (which returns -1 if the tip doesn't exist). To
2288
- // make sure we're not changing behaviour, let's check that
2289
- // ::ChainActive() is the same object as m_chain (not just
2290
- // identical).
2291
- //
2292
- // This comment and the following assert will be removed in a
2293
- // subsequent commit, as they're just meant to demonstrate
2294
- // correctness (you can run tests against it and see that nothing
2295
- // exit unexpectedly).
2296
- assert (std::addressof (::ChainActive ()) == std::addressof (m_chain));
2297
2284
if (nManualPruneHeight > 0 ) {
2298
2285
LOG_TIME_MILLIS_WITH_CATEGORY (" find files to prune (manual)" , BCLog::BENCH);
2299
2286
2300
2287
m_blockman.FindFilesToPruneManual (setFilesToPrune, nManualPruneHeight, m_chain.Height ());
2301
2288
} else {
2302
2289
LOG_TIME_MILLIS_WITH_CATEGORY (" find files to prune" , BCLog::BENCH);
2303
2290
2304
- // Previously, we called the global function
2305
- // ::ChainstateActive() in FindFilesToPrune{,Manual} to get the
2306
- // IBD status. Now, we are simply passing in
2307
- // IsInitialBlockDownload(). To make sure we're not changing
2308
- // behaviour, let's check that ::ChainstateActive() is the same
2309
- // object as *this (not just identical).
2310
- //
2311
- // This comment and the following assert will be removed in a
2312
- // subsequent commit, as they're just meant to demonstrate
2313
- // correctness (you can run tests against it and see that
2314
- // nothing exit unexpectedly).
2315
- assert (std::addressof (::ChainstateActive ()) == std::addressof (*this ));
2316
-
2317
- // Previously, we called PruneOneBlockFile on g_chainman's
2318
- // m_blockman in FindFilesToPrune{,Manual}. Now, we are instead
2319
- // calling PruneOneBlockFile on _our_ m_blockman. To make sure
2320
- // we're not changing behaviour, let's check that
2321
- // g_chainman.m_blockman is the same object as _our_ m_blockman
2322
- // (not just identical).
2323
- //
2324
- // This comment and the following assert will be removed in a
2325
- // subsequent commit, as they're just meant to demonstrate
2326
- // correctness (you can run tests against it and see that
2327
- // nothing exit unexpectedly).
2328
- assert (std::addressof (g_chainman.m_blockman ) == std::addressof (m_blockman));
2329
-
2330
2291
m_blockman.FindFilesToPrune (setFilesToPrune, chainparams.PruneAfterHeight (), m_chain.Height (), IsInitialBlockDownload ());
2331
2292
fCheckForPruning = false ;
2332
2293
}
0 commit comments