mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Allow quicker shutdowns during LoadBlockIndex()
This commit is contained in:
parent
f030410e88
commit
af5fa82b67
3 changed files with 3 additions and 0 deletions
|
|
@ -3855,6 +3855,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue