Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 2,878 Lines • ▼ Show 20 Lines | void CConnman::RecordBytesSent(uint64_t bytes) { | ||||
uint64_t now = GetTime(); | uint64_t now = GetTime(); | ||||
if (nMaxOutboundCycleStartTime + nMaxOutboundTimeframe < now) { | if (nMaxOutboundCycleStartTime + nMaxOutboundTimeframe < now) { | ||||
// timeframe expired, reset cycle | // timeframe expired, reset cycle | ||||
nMaxOutboundCycleStartTime = now; | nMaxOutboundCycleStartTime = now; | ||||
nMaxOutboundTotalBytesSentInCycle = 0; | nMaxOutboundTotalBytesSentInCycle = 0; | ||||
} | } | ||||
// TODO, exclude peers with noban permission | // TODO, exclude peers with download permission | ||||
nMaxOutboundTotalBytesSentInCycle += bytes; | nMaxOutboundTotalBytesSentInCycle += bytes; | ||||
} | } | ||||
void CConnman::SetMaxOutboundTarget(uint64_t limit) { | void CConnman::SetMaxOutboundTarget(uint64_t limit) { | ||||
LOCK(cs_totalBytesSent); | LOCK(cs_totalBytesSent); | ||||
nMaxOutboundLimit = limit; | nMaxOutboundLimit = limit; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |