aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-09-15 14:16:04 -0400
committerCarl Dong <contact@carldong.me>2020-09-21 13:30:27 -0400
commit72a1d5c6f3834e206719ee5121df7727aed5b786 (patch)
tree35c0f795a1adc5e1c9dc6b83f1e35f6320ce954f /src/validation.cpp
parent3756853b15902d63f4b5a3129e8b5d82e84e125b (diff)
downloadbitcoin-72a1d5c6f3834e206719ee5121df7727aed5b786.tar.xz
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.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 97b185e9ca..47aed6d0d4 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2281,19 +2281,6 @@ bool CChainState::FlushStateToDisk(
CoinsCacheSizeState cache_state = GetCoinsCacheSizeState(&m_mempool);
LOCK(cs_LastBlockFile);
if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) {
- // Previously, we called the global function ::ChainActive() in
- // FindFilesToPrune{,Manual} to get the tip height and to determine
- // whether or not a tip even exists. Now, we are simply passing in
- // m_chain.Height() (which returns -1 if the tip doesn't exist). To
- // make sure we're not changing behaviour, let's check that
- // ::ChainActive() is the same object as m_chain (not just
- // identical).
- //
- // This comment and the following assert will be removed in a
- // subsequent commit, as they're just meant to demonstrate
- // correctness (you can run tests against it and see that nothing
- // exit unexpectedly).
- assert(std::addressof(::ChainActive()) == std::addressof(m_chain));
if (nManualPruneHeight > 0) {
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune (manual)", BCLog::BENCH);
@@ -2301,32 +2288,6 @@ bool CChainState::FlushStateToDisk(
} else {
LOG_TIME_MILLIS_WITH_CATEGORY("find files to prune", BCLog::BENCH);
- // Previously, we called the global function
- // ::ChainstateActive() in FindFilesToPrune{,Manual} to get the
- // IBD status. Now, we are simply passing in
- // IsInitialBlockDownload(). To make sure we're not changing
- // behaviour, let's check that ::ChainstateActive() is the same
- // object as *this (not just identical).
- //
- // This comment and the following assert will be removed in a
- // subsequent commit, as they're just meant to demonstrate
- // correctness (you can run tests against it and see that
- // nothing exit unexpectedly).
- assert(std::addressof(::ChainstateActive()) == std::addressof(*this));
-
- // Previously, we called PruneOneBlockFile on g_chainman's
- // m_blockman in FindFilesToPrune{,Manual}. Now, we are instead
- // calling PruneOneBlockFile on _our_ m_blockman. To make sure
- // we're not changing behaviour, let's check that
- // g_chainman.m_blockman is the same object as _our_ m_blockman
- // (not just identical).
- //
- // This comment and the following assert will be removed in a
- // subsequent commit, as they're just meant to demonstrate
- // correctness (you can run tests against it and see that
- // nothing exit unexpectedly).
- assert(std::addressof(g_chainman.m_blockman) == std::addressof(m_blockman));
-
m_blockman.FindFilesToPrune(setFilesToPrune, chainparams.PruneAfterHeight(), m_chain.Height(), IsInitialBlockDownload());
fCheckForPruning = false;
}