| 1974 | } |
| 1975 | |
| 1976 | bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex& block_index) |
| 1977 | { |
| 1978 | AssertLockHeld(cs_main); |
| 1979 | if (m_chainman.ActiveChain().Contains(block_index)) return true; |
| 1980 | return block_index.IsValid(BLOCK_VALID_SCRIPTS) && (m_chainman.m_best_header != nullptr) && |
| 1981 | (m_chainman.m_best_header->GetBlockTime() - block_index.GetBlockTime() < STALE_RELAY_AGE_LIMIT) && |
| 1982 | (GetBlockProofEquivalentTime(*m_chainman.m_best_header, block_index, *m_chainman.m_best_header, m_chainparams.GetConsensus()) < STALE_RELAY_AGE_LIMIT); |
| 1983 | } |
| 1984 | |
| 1985 | util::Expected<void, std::string> PeerManagerImpl::FetchBlock(NodeId peer_id, const CBlockIndex& block_index) |
| 1986 | { |
nothing calls this directly
no test coverage detected