| 515 | } |
| 516 | |
| 517 | std::optional<BlockRef> GetTip(ChainstateManager& chainman) |
| 518 | { |
| 519 | LOCK(::cs_main); |
| 520 | CBlockIndex* tip{chainman.ActiveChain().Tip()}; |
| 521 | if (!tip) return {}; |
| 522 | return BlockRef{tip->GetBlockHash(), tip->nHeight}; |
| 523 | } |
| 524 | |
| 525 | bool CooldownIfHeadersAhead(ChainstateManager& chainman, KernelNotifications& kernel_notifications, const BlockRef& last_tip, bool& interrupt_mining) |
| 526 | { |
no test coverage detected