mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-02-14 09:18:37 +00:00
Merge pull request #2434 from patricklodder/1.14-activatebestchain-shutdown-fix
bugfix: break ActivateBestChain() differently on shutdown
This commit is contained in:
commit
7ebedc2aa3
@ -2504,9 +2504,6 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
||||
CBlockIndex *pindexMostWork = NULL;
|
||||
CBlockIndex *pindexNewTip = NULL;
|
||||
do {
|
||||
boost::this_thread::interruption_point();
|
||||
if (ShutdownRequested())
|
||||
break;
|
||||
|
||||
const CBlockIndex *pindexFork;
|
||||
ConnectTrace connectTrace;
|
||||
@ -2566,6 +2563,15 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
|
||||
if (pindexFork != pindexNewTip) {
|
||||
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);
|
||||
}
|
||||
|
||||
// Perform the shutdown detection to the end of the loop to prevent
|
||||
// pindexNewTip being nil
|
||||
boost::this_thread::interruption_point();
|
||||
if (ShutdownRequested()) {
|
||||
LogPrintf("ActivateBestChain: shutdown requested, breaking loop\n");
|
||||
break;
|
||||
}
|
||||
|
||||
} while (pindexNewTip != pindexMostWork);
|
||||
CheckBlockIndex(chainparams.GetConsensus(pindexNewTip->nHeight));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user