diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2019-05-19 10:43:13 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2019-05-19 10:43:32 +0200 |
commit | 7110d455eb51e78e09f43fabf0b1630ae997d898 (patch) | |
tree | 0c0a7b72aaa6f303af170e56032bd525eeec7c18 /src/validation.cpp | |
parent | 387eb5b34307448f16d3769ac0245c4e3d996a38 (diff) | |
parent | af5fa82b676a36e60eda080ca0a946bdfffefd49 (diff) |
Merge #12980: Allow quicker shutdowns during LoadBlockIndex()
af5fa82b6 Allow quicker shutdowns during LoadBlockIndex() (Jonas Schnelli)
Pull request description:
ACKs for commit af5fa8:
promag:
utACK af5fa82b676a36e60eda080ca0a946bdfffefd49.
practicalswift:
utACK af5fa82b676a36e60eda080ca0a946bdfffefd49
Tree-SHA512: 1c64dcc5d8a9d3411553257cd5a598dcd29be981660e5bca9283c1d957dc56798abcf41d9969cd573088137597a23e48e62a8c476c463d3f176b86a10048f47b
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index b2d84f4c95..4347e0b0cc 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3861,6 +3861,7 @@ bool CChainState::LoadBlockIndex(const Consensus::Params& consensus_params, CBlo sort(vSortedByHeight.begin(), vSortedByHeight.end()); for (const std::pair<int, CBlockIndex*>& item : vSortedByHeight) { + if (ShutdownRequested()) return false; CBlockIndex* pindex = item.second; pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + GetBlockProof(*pindex); pindex->nTimeMax = (pindex->pprev ? std::max(pindex->pprev->nTimeMax, pindex->nTime) : pindex->nTime); |