mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
Merge #10569: Fix stopatheight
c45cbaf
Fix stopatheight (Andrew Chow)
Tree-SHA512: 7df07ca1d40a5a3a8d93ad8943cd04954d587e19bbb63ed084b7aff9503788ec73a1045fbfc4a36d9775975032c2ee0bcc76eb4da10e879f483eaa6f351c19b2
This commit is contained in:
commit
2e7d8f8b7d
1 changed files with 3 additions and 3 deletions
|
@ -2294,6 +2294,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
||||||
|
|
||||||
CBlockIndex *pindexMostWork = NULL;
|
CBlockIndex *pindexMostWork = NULL;
|
||||||
CBlockIndex *pindexNewTip = NULL;
|
CBlockIndex *pindexNewTip = NULL;
|
||||||
|
int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
|
||||||
do {
|
do {
|
||||||
boost::this_thread::interruption_point();
|
boost::this_thread::interruption_point();
|
||||||
if (ShutdownRequested())
|
if (ShutdownRequested())
|
||||||
|
@ -2343,6 +2344,8 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
||||||
if (pindexFork != pindexNewTip) {
|
if (pindexFork != pindexNewTip) {
|
||||||
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);
|
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();
|
||||||
} while (pindexNewTip != pindexMostWork);
|
} while (pindexNewTip != pindexMostWork);
|
||||||
CheckBlockIndex(chainparams.GetConsensus());
|
CheckBlockIndex(chainparams.GetConsensus());
|
||||||
|
|
||||||
|
@ -2351,9 +2354,6 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
|
|
||||||
if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue