MCPcopy Create free account
hub / github.com/ElementsProject/elements / BlockRequestAllowed

Method BlockRequestAllowed

src/net_processing.cpp:1433–1440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1431}
1432
1433bool 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
1442std::optional<std::string> PeerManagerImpl::FetchBlock(NodeId peer_id, const CBlockIndex& block_index)
1443{

Callers

nothing calls this directly

Calls 4

ContainsMethod · 0.45
IsValidMethod · 0.45
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected