Skip to content

Commit fa1d580

Browse files
author
MarcoFalke
committed
validation: Remove unused boost interruption_point
ActivateBestChain (ABC) is only called in the "msghand" or one of the RPC threads, neither of which is a boost::thread. However, ABC is also called in ThreadImport (which currently happens to be a boost::thread). In all cases, the interruption_point is redundant with the breakpoint in ABC that triggers when ShutdownRequested() VerifyDB is only called in the main thread ("init") or one of the RPC threads, neither of which is a boost::thread.
1 parent 3657aee commit fa1d580

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/validation.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include <string>
5151

5252
#include <boost/algorithm/string/replace.hpp>
53-
#include <boost/thread.hpp>
5453

5554
#if defined(NDEBUG)
5655
# error "Bitcoin cannot be compiled without assertions."
@@ -2859,8 +2858,6 @@ bool CChainState::ActivateBestChain(BlockValidationState &state, const CChainPar
28592858
CBlockIndex *pindexNewTip = nullptr;
28602859
int nStopAtHeight = gArgs.GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
28612860
do {
2862-
boost::this_thread::interruption_point();
2863-
28642861
// Block until the validation queue drains. This should largely
28652862
// never happen in normal operation, however may happen during
28662863
// reindex, causing memory blowup if we run too far ahead.
@@ -2929,8 +2926,7 @@ bool CChainState::ActivateBestChain(BlockValidationState &state, const CChainPar
29292926
// never shutdown before connecting the genesis block during LoadChainTip(). Previously this
29302927
// caused an assert() failure during shutdown in such cases as the UTXO DB flushing checks
29312928
// that the best block hash is non-null.
2932-
if (ShutdownRequested())
2933-
break;
2929+
if (ShutdownRequested()) break;
29342930
} while (pindexNewTip != pindexMostWork);
29352931
CheckBlockIndex(chainparams.GetConsensus());
29362932

@@ -4272,7 +4268,6 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
42724268
int reportDone = 0;
42734269
LogPrintf("[0%%]..."); /* Continued */
42744270
for (pindex = ::ChainActive().Tip(); pindex && pindex->pprev; pindex = pindex->pprev) {
4275-
boost::this_thread::interruption_point();
42764271
const int percentageDone = std::max(1, std::min(99, (int)(((double)(::ChainActive().Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
42774272
if (reportDone < percentageDone/10) {
42784273
// report every 10% step
@@ -4330,7 +4325,6 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
43304325
// check level 4: try reconnecting blocks
43314326
if (nCheckLevel >= 4) {
43324327
while (pindex != ::ChainActive().Tip()) {
4333-
boost::this_thread::interruption_point();
43344328
const int percentageDone = std::max(1, std::min(99, 100 - (int)(((double)(::ChainActive().Height() - pindex->nHeight)) / (double)nCheckDepth * 50)));
43354329
if (reportDone < percentageDone/10) {
43364330
// report every 10% step

0 commit comments

Comments
 (0)