MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / OutboundTargetReached

Method OutboundTargetReached

src/net.cpp:2644–2662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2642}
2643
2644bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit)
2645{
2646 LOCK(cs_totalBytesSent);
2647 if (nMaxOutboundLimit == 0)
2648 return false;
2649
2650 if (historicalBlockServingLimit)
2651 {
2652 // keep a large enough buffer to at least relay each block once
2653 uint64_t timeLeftInCycle = GetMaxOutboundTimeLeftInCycle();
2654 uint64_t buffer = timeLeftInCycle / 600 * MAX_BLOCK_SERIALIZED_SIZE;
2655 if (buffer >= nMaxOutboundLimit || nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit - buffer)
2656 return true;
2657 }
2658 else if (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit)
2659 return true;
2660
2661 return false;
2662}
2663
2664uint64_t CConnman::GetOutboundTargetBytesLeft()
2665{

Callers 3

ProcessGetBlockDataFunction · 0.80
ProcessMessageFunction · 0.80
getnettotalsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected