| 2795 | } |
| 2796 | |
| 2797 | static void NotifyHeaderTip() LOCKS_EXCLUDED(cs_main) { |
| 2798 | bool fNotify = false; |
| 2799 | bool fInitialBlockDownload = false; |
| 2800 | static CBlockIndex* pindexHeaderOld = nullptr; |
| 2801 | CBlockIndex* pindexHeader = nullptr; |
| 2802 | { |
| 2803 | LOCK(cs_main); |
| 2804 | pindexHeader = pindexBestHeader; |
| 2805 | |
| 2806 | if (pindexHeader != pindexHeaderOld) { |
| 2807 | fNotify = true; |
| 2808 | fInitialBlockDownload = IsInitialBlockDownload(); |
| 2809 | pindexHeaderOld = pindexHeader; |
| 2810 | } |
| 2811 | } |
| 2812 | // Send block tip changed notifications without cs_main |
| 2813 | if (fNotify) { |
| 2814 | uiInterface.NotifyHeaderTip(fInitialBlockDownload, pindexHeader); |
| 2815 | } |
| 2816 | } |
| 2817 | |
| 2818 | /** |
| 2819 | * Make the best chain active, in multiple steps. The result is either failure |
no test coverage detected