Skip to content

Commit 2e7d8f8

Browse files
committed
Merge #10569: Fix stopatheight
c45cbaf Fix stopatheight (Andrew Chow) Tree-SHA512: 7df07ca1d40a5a3a8d93ad8943cd04954d587e19bbb63ed084b7aff9503788ec73a1045fbfc4a36d9775975032c2ee0bcc76eb4da10e879f483eaa6f351c19b2
2 parents 76f268b + c45cbaf commit 2e7d8f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/validation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,6 +2294,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
22942294

22952295
CBlockIndex *pindexMostWork = NULL;
22962296
CBlockIndex *pindexNewTip = NULL;
2297+
int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
22972298
do {
22982299
boost::this_thread::interruption_point();
22992300
if (ShutdownRequested())
@@ -2343,6 +2344,8 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
23432344
if (pindexFork != pindexNewTip) {
23442345
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);
23452346
}
2347+
2348+
if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();
23462349
} while (pindexNewTip != pindexMostWork);
23472350
CheckBlockIndex(chainparams.GetConsensus());
23482351

@@ -2351,9 +2354,6 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
23512354
return false;
23522355
}
23532356

2354-
int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
2355-
if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();
2356-
23572357
return true;
23582358
}
23592359

0 commit comments

Comments
 (0)