MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / NotifyHeaderTip

Method NotifyHeaderTip

src/validation.cpp:3303–3323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3301}
3302
3303bool ChainstateManager::NotifyHeaderTip()
3304{
3305 bool fNotify = false;
3306 bool fInitialBlockDownload = false;
3307 CBlockIndex* pindexHeader = nullptr;
3308 {
3309 LOCK(GetMutex());
3310 pindexHeader = m_best_header;
3311
3312 if (pindexHeader != m_last_notified_header) {
3313 fNotify = true;
3314 fInitialBlockDownload = IsInitialBlockDownload();
3315 m_last_notified_header = pindexHeader;
3316 }
3317 }
3318 // Send block tip changed notifications without the lock held
3319 if (fNotify) {
3320 GetNotifications().headerTip(GetSynchronizationState(fInitialBlockDownload, m_blockman.m_blockfiles_indexed), pindexHeader->nHeight, pindexHeader->nTime, false);
3321 }
3322 return fNotify;
3323}
3324
3325static void LimitValidationInterfaceQueue(ValidationSignals& signals) LOCKS_EXCLUDED(cs_main) {
3326 AssertLockNotHeld(cs_main);

Callers 1

headerTipMethod · 0.80

Calls 2

GetSynchronizationStateFunction · 0.85
headerTipMethod · 0.45

Tested by

no test coverage detected