| 1431 | } |
| 1432 | |
| 1433 | bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex* pindex) |
| 1434 | { |
| 1435 | AssertLockHeld(cs_main); |
| 1436 | if (m_chainman.ActiveChain().Contains(pindex)) return true; |
| 1437 | return pindex->IsValid(BLOCK_VALID_SCRIPTS) && (pindexBestHeader != nullptr) && |
| 1438 | (pindexBestHeader->GetBlockTime() - pindex->GetBlockTime() < STALE_RELAY_AGE_LIMIT) && |
| 1439 | (GetBlockProofEquivalentTime(*pindexBestHeader, *pindex, *pindexBestHeader, m_chainparams.GetConsensus()) < STALE_RELAY_AGE_LIMIT); |
| 1440 | } |
| 1441 | |
| 1442 | std::optional<std::string> PeerManagerImpl::FetchBlock(NodeId peer_id, const CBlockIndex& block_index) |
| 1443 | { |
nothing calls this directly
no test coverage detected