|
|
@ -2607,18 +2607,17 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& |
|
|
|
assert(trace.pblock && trace.pindex); |
|
|
|
assert(trace.pblock && trace.pindex); |
|
|
|
GetMainSignals().BlockConnected(trace.pblock, trace.pindex, trace.conflictedTxs); |
|
|
|
GetMainSignals().BlockConnected(trace.pblock, trace.pindex, trace.conflictedTxs); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// When we reach this point, we switched to a new tip (stored in pindexNewTip).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notifications/callbacks that can run without cs_main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify external listeners about the new tip.
|
|
|
|
// Notify external listeners about the new tip.
|
|
|
|
GetMainSignals().UpdatedBlockTip(pindexNewTip, pindexFork, fInitialDownload); |
|
|
|
// Enqueue while holding cs_main to ensure that UpdatedBlockTip is called in the order in which blocks are connected
|
|
|
|
|
|
|
|
GetMainSignals().UpdatedBlockTip(pindexNewTip, pindexFork, fInitialDownload); |
|
|
|
|
|
|
|
|
|
|
|
// Always notify the UI if a new block tip was connected
|
|
|
|
// Always notify the UI if a new block tip was connected
|
|
|
|
if (pindexFork != pindexNewTip) { |
|
|
|
if (pindexFork != pindexNewTip) { |
|
|
|
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip); |
|
|
|
uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// When we reach this point, we switched to a new tip (stored in pindexNewTip).
|
|
|
|
|
|
|
|
|
|
|
|
if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown(); |
|
|
|
if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown(); |
|
|
|
|
|
|
|
|
|
|
|