| 2634 | } |
| 2635 | |
| 2636 | bool IsInitialBlockDownload() { |
| 2637 | LOCK(cs_main); |
| 2638 | if (SysCfg().IsImporting() || |
| 2639 | SysCfg().IsReindex()) |
| 2640 | return true; |
| 2641 | |
| 2642 | static int64_t nLastUpdate; |
| 2643 | static CBlockIndex *pIndexLastBest; |
| 2644 | if (chainActive.Tip() != pIndexLastBest) { |
| 2645 | pIndexLastBest = chainActive.Tip(); |
| 2646 | nLastUpdate = GetTime(); |
| 2647 | } |
| 2648 | |
| 2649 | return (GetTime() - nLastUpdate < 10 && chainActive.Tip()->GetBlockTime() < GetTime() - 24 * 60 * 60); |
| 2650 | } |
no test coverage detected