Skip to content

Commit 72a1d5c

Browse files
committed
validation: Remove review-only comments + assertions
[META] This is a followup to "validation: Move FindFilesToPrune{,Manual} to BlockManager" removing comments and assertions meant only to show that the change is correct.
1 parent 3756853 commit 72a1d5c

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/validation.cpp

-39
Original file line numberDiff line numberDiff line change
@@ -2281,52 +2281,13 @@ bool CChainState::FlushStateToDisk(
22812281
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState(&m_mempool);
22822282
LOCK(cs_LastBlockFile);
22832283
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));
22972284
if (nManualPruneHeight > 0) {
22982285
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune (manual)", BCLog::BENCH);
22992286

23002287
m_blockman.FindFilesToPruneManual(setFilesToPrune, nManualPruneHeight, m_chain.Height());
23012288
} else {
23022289
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune", BCLog::BENCH);
23032290

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-
23302291
m_blockman.FindFilesToPrune(setFilesToPrune, chainparams.PruneAfterHeight(), m_chain.Height(), IsInitialBlockDownload());
23312292
fCheckForPruning = false;
23322293
}

0 commit comments

Comments
 (0)