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

Method CanDirectFetch

src/net_processing.cpp:993–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991}
992
993bool PeerManagerImpl::CanDirectFetch()
994{
995 if(!m_chainman.ActiveChain().Tip()) {
996 LogPrint(BCLog::NET, "Tried to call CanDirectFetch with no currently-active chain.\n");
997 return false;
998 }
999 return m_chainman.ActiveChain().Tip()->GetBlockTime() > GetAdjustedTime() - m_chainparams.GetConsensus().nPowTargetSpacing * 20;
1000}
1001
1002static bool PeerHasHeader(CNodeState *state, const CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1003{

Callers

nothing calls this directly

Calls 3

GetAdjustedTimeFunction · 0.85
TipMethod · 0.45
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected