aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-06-11 13:51:46 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-06-11 14:03:19 +0200
commit2e7d8f8b7d98b9d60a6304e2853df23301cbd600 (patch)
treeba40d6362ba07432aa50de553938daa525d5c541
parent76f268b9bd1b69eb7784c5324abbb67f3e395b97 (diff)
parentc45cbaf69f4fe6c8dabd48205da3bf302ed99c8a (diff)
downloadbitcoin-2e7d8f8b7d98b9d60a6304e2853df23301cbd600.tar.xz
Merge #10569: Fix stopatheight
c45cbaf Fix stopatheight (Andrew Chow) Tree-SHA512: 7df07ca1d40a5a3a8d93ad8943cd04954d587e19bbb63ed084b7aff9503788ec73a1045fbfc4a36d9775975032c2ee0bcc76eb4da10e879f483eaa6f351c19b2
-rw-r--r--src/validation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index eaefa95411..9fd6bee2aa 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2294,6 +2294,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
CBlockIndex *pindexMostWork = NULL;
CBlockIndex *pindexNewTip = NULL;
+ int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
do {
boost::this_thread::interruption_point();
if (ShutdownRequested())
@@ -2343,6 +2344,8 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
if (pindexFork != pindexNewTip) {
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);
}
+
+ if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();
} while (pindexNewTip != pindexMostWork);
CheckBlockIndex(chainparams.GetConsensus());
@@ -2351,9 +2354,6 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
return false;
}
- int nStopAtHeight = GetArg("-stopatheight", DEFAULT_STOPATHEIGHT);
- if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();
-
return true;
}