| 3159 | } |
| 3160 | |
| 3161 | static bool NotifyHeaderTip(CChainState& chainstate) LOCKS_EXCLUDED(cs_main) { |
| 3162 | bool fNotify = false; |
| 3163 | bool fInitialBlockDownload = false; |
| 3164 | static CBlockIndex* pindexHeaderOld = nullptr; |
| 3165 | CBlockIndex* pindexHeader = nullptr; |
| 3166 | { |
| 3167 | LOCK(cs_main); |
| 3168 | pindexHeader = pindexBestHeader; |
| 3169 | |
| 3170 | if (pindexHeader != pindexHeaderOld) { |
| 3171 | fNotify = true; |
| 3172 | fInitialBlockDownload = chainstate.IsInitialBlockDownload(); |
| 3173 | pindexHeaderOld = pindexHeader; |
| 3174 | } |
| 3175 | } |
| 3176 | // Send block tip changed notifications without cs_main |
| 3177 | if (fNotify) { |
| 3178 | uiInterface.NotifyHeaderTip(GetSynchronizationState(fInitialBlockDownload), pindexHeader); |
| 3179 | } |
| 3180 | return fNotify; |
| 3181 | } |
| 3182 | |
| 3183 | static void LimitValidationInterfaceQueue() LOCKS_EXCLUDED(cs_main) { |
| 3184 | AssertLockNotHeld(cs_main); |
nothing calls this directly
no test coverage detected