50
50
#include < string>
51
51
52
52
#include < boost/algorithm/string/replace.hpp>
53
- #include < boost/thread.hpp>
54
53
55
54
#if defined(NDEBUG)
56
55
# error "Bitcoin cannot be compiled without assertions."
@@ -2859,8 +2858,6 @@ bool CChainState::ActivateBestChain(BlockValidationState &state, const CChainPar
2859
2858
CBlockIndex *pindexNewTip = nullptr ;
2860
2859
int nStopAtHeight = gArgs .GetArg (" -stopatheight" , DEFAULT_STOPATHEIGHT);
2861
2860
do {
2862
- boost::this_thread::interruption_point ();
2863
-
2864
2861
// Block until the validation queue drains. This should largely
2865
2862
// never happen in normal operation, however may happen during
2866
2863
// reindex, causing memory blowup if we run too far ahead.
@@ -2929,8 +2926,7 @@ bool CChainState::ActivateBestChain(BlockValidationState &state, const CChainPar
2929
2926
// never shutdown before connecting the genesis block during LoadChainTip(). Previously this
2930
2927
// caused an assert() failure during shutdown in such cases as the UTXO DB flushing checks
2931
2928
// that the best block hash is non-null.
2932
- if (ShutdownRequested ())
2933
- break ;
2929
+ if (ShutdownRequested ()) break ;
2934
2930
} while (pindexNewTip != pindexMostWork);
2935
2931
CheckBlockIndex (chainparams.GetConsensus ());
2936
2932
@@ -4272,7 +4268,6 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
4272
4268
int reportDone = 0 ;
4273
4269
LogPrintf (" [0%%]..." ); /* Continued */
4274
4270
for (pindex = ::ChainActive ().Tip (); pindex && pindex->pprev ; pindex = pindex->pprev ) {
4275
- boost::this_thread::interruption_point ();
4276
4271
const int percentageDone = std::max (1 , std::min (99 , (int )(((double )(::ChainActive ().Height () - pindex->nHeight )) / (double )nCheckDepth * (nCheckLevel >= 4 ? 50 : 100 ))));
4277
4272
if (reportDone < percentageDone/10 ) {
4278
4273
// report every 10% step
@@ -4318,8 +4313,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
4318
4313
nGoodTransactions += block.vtx .size ();
4319
4314
}
4320
4315
}
4321
- if (ShutdownRequested ())
4322
- return true ;
4316
+ if (ShutdownRequested ()) return true ;
4323
4317
}
4324
4318
if (pindexFailure)
4325
4319
return error (" VerifyDB(): *** coin database inconsistencies found (last %i blocks, %i good transactions before that)\n " , ::ChainActive ().Height () - pindexFailure->nHeight + 1 , nGoodTransactions);
@@ -4330,7 +4324,6 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
4330
4324
// check level 4: try reconnecting blocks
4331
4325
if (nCheckLevel >= 4 ) {
4332
4326
while (pindex != ::ChainActive ().Tip ()) {
4333
- boost::this_thread::interruption_point ();
4334
4327
const int percentageDone = std::max (1 , std::min (99 , 100 - (int )(((double )(::ChainActive ().Height () - pindex->nHeight )) / (double )nCheckDepth * 50 )));
4335
4328
if (reportDone < percentageDone/10 ) {
4336
4329
// report every 10% step
@@ -4344,6 +4337,7 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
4344
4337
return error (" VerifyDB(): *** ReadBlockFromDisk failed at %d, hash=%s" , pindex->nHeight , pindex->GetBlockHash ().ToString ());
4345
4338
if (!::ChainstateActive ().ConnectBlock (block, state, pindex, coins, chainparams))
4346
4339
return error (" VerifyDB(): *** found unconnectable block at %d, hash=%s (%s)" , pindex->nHeight , pindex->GetBlockHash ().ToString (), state.ToString ());
4340
+ if (ShutdownRequested ()) return true ;
4347
4341
}
4348
4342
}
4349
4343
0 commit comments