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

Method OutboundTargetReached

src/net.cpp:2980–2998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2978}
2979
2980bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
2981{
2982 LOCK(cs_totalBytesSent);
2983 if (nMaxOutboundLimit == 0)
2984 return false;
2985
2986 if (historicalBlockServingLimit)
2987 {
2988 // keep a large enough buffer to at least relay each block once
2989 const std::chrono::seconds timeLeftInCycle = GetMaxOutboundTimeLeftInCycle();
2990 const uint64_t buffer = timeLeftInCycle / std::chrono::minutes{10} * MAX_BLOCK_SERIALIZED_SIZE;
2991 if (buffer >= nMaxOutboundLimit || nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit - buffer)
2992 return true;
2993 }
2994 else if (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit)
2995 return true;
2996
2997 return false;
2998}
2999
3000uint64_t CConnman::GetOutboundTargetBytesLeft() const
3001{

Callers 4

ProcessGetBlockDataMethod · 0.80
ProcessMessageMethod · 0.80
FUZZ_TARGET_INITFunction · 0.80
getnettotalsFunction · 0.80

Calls

no outgoing calls

Tested by 1

FUZZ_TARGET_INITFunction · 0.64