init: Pass post-Blossom spacing into CNode::SetMaxOutboundTarget()
This commit is contained in:
parent
0f66b1e138
commit
51ae7a0ae5
|
@ -1376,7 +1376,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||
}
|
||||
#endif
|
||||
if (mapArgs.count("-maxuploadtarget")) {
|
||||
CNode::SetMaxOutboundTarget(GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET)*1024*1024);
|
||||
CNode::SetMaxOutboundTarget(
|
||||
chainparams.GetConsensus().nPostBlossomPowTargetSpacing,
|
||||
GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET)*1024*1024);
|
||||
}
|
||||
|
||||
// ********************************************************* Step 7: load block chain
|
||||
|
|
|
@ -2020,10 +2020,10 @@ void CNode::RecordBytesSent(uint64_t bytes)
|
|||
nMaxOutboundTotalBytesSentInCycle += bytes;
|
||||
}
|
||||
|
||||
void CNode::SetMaxOutboundTarget(uint64_t limit)
|
||||
void CNode::SetMaxOutboundTarget(uint64_t targetSpacing, uint64_t limit)
|
||||
{
|
||||
LOCK(cs_totalBytesSent);
|
||||
uint64_t recommendedMinimum = (nMaxOutboundTimeframe / 600) * MAX_BLOCK_SIZE;
|
||||
uint64_t recommendedMinimum = (nMaxOutboundTimeframe / targetSpacing) * MAX_BLOCK_SIZE;
|
||||
nMaxOutboundLimit = limit;
|
||||
|
||||
if (limit > 0 && limit < recommendedMinimum)
|
||||
|
|
|
@ -675,7 +675,7 @@ public:
|
|||
static uint64_t GetTotalBytesSent();
|
||||
|
||||
//!set the max outbound target in bytes
|
||||
static void SetMaxOutboundTarget(uint64_t limit);
|
||||
static void SetMaxOutboundTarget(uint64_t targetSpacing, uint64_t limit);
|
||||
static uint64_t GetMaxOutboundTarget();
|
||||
|
||||
//!set the timeframe for the max outbound target
|
||||
|
|
Loading…
Reference in New Issue