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

Method GetMaxOutboundTimeLeftInCycle

src/net.cpp:2966–2978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2964}
2965
2966std::chrono::seconds CConnman::GetMaxOutboundTimeLeftInCycle() const
2967{
2968 LOCK(cs_totalBytesSent);
2969 if (nMaxOutboundLimit == 0)
2970 return 0s;
2971
2972 if (nMaxOutboundCycleStartTime.count() == 0)
2973 return MAX_UPLOAD_TIMEFRAME;
2974
2975 const std::chrono::seconds cycleEndTime = nMaxOutboundCycleStartTime + MAX_UPLOAD_TIMEFRAME;
2976 const auto now = GetTime<std::chrono::seconds>();
2977 return (cycleEndTime < now) ? 0s : cycleEndTime - now;
2978}
2979
2980bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
2981{

Callers 2

FUZZ_TARGET_INITFunction · 0.80
getnettotalsFunction · 0.80

Calls 1

countMethod · 0.80

Tested by 1

FUZZ_TARGET_INITFunction · 0.64