From 72a1d5c6f3834e206719ee5121df7727aed5b786 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 15 Sep 2020 14:16:04 -0400 Subject: 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. --- src/validation.cpp | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'src/validation.cpp') 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; } -- cgit v1.2.3