| 981 | } |
| 982 | |
| 983 | bool PeerManagerImpl::TipMayBeStale() |
| 984 | { |
| 985 | AssertLockHeld(cs_main); |
| 986 | const Consensus::Params& consensusParams = m_chainparams.GetConsensus(); |
| 987 | if (m_last_tip_update.load() == 0s) { |
| 988 | m_last_tip_update = GetTime<std::chrono::seconds>(); |
| 989 | } |
| 990 | return m_last_tip_update.load() < GetTime<std::chrono::seconds>() - std::chrono::seconds{consensusParams.nPowTargetSpacing * 3} && mapBlocksInFlight.empty(); |
| 991 | } |
| 992 | |
| 993 | bool PeerManagerImpl::CanDirectFetch() |
| 994 | { |