mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
Merge #8707: net: fix maxuploadtarget setting
f3552da
net: fix maxuploadtarget setting (Cory Fields)
This commit is contained in:
parent
699db99321
commit
af5d18ad5c
@ -1432,8 +1432,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
pdsNotificationInterface = new CDSNotificationInterface(connman);
|
||||
RegisterValidationInterface(pdsNotificationInterface);
|
||||
|
||||
uint64_t nMaxOutboundLimit = 0; //unlimited unless -maxuploadtarget is set
|
||||
uint64_t nMaxOutboundTimeframe = MAX_UPLOAD_TIMEFRAME;
|
||||
|
||||
if (mapArgs.count("-maxuploadtarget")) {
|
||||
connman.SetMaxOutboundTarget(GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET)*1024*1024);
|
||||
nMaxOutboundLimit = GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET)*1024*1024;
|
||||
}
|
||||
|
||||
// ********************************************************* Step 7: load block chain
|
||||
@ -1847,6 +1850,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
connOptions.nSendBufferMaxSize = 1000*GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
|
||||
connOptions.nReceiveFloodSize = 1000*GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
|
||||
|
||||
connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe;
|
||||
connOptions.nMaxOutboundLimit = nMaxOutboundLimit;
|
||||
|
||||
if (!connman.Start(scheduler, strNodeError, connOptions))
|
||||
return InitError(strNodeError);
|
||||
|
||||
|
@ -2153,9 +2153,7 @@ bool CConnman::Start(CScheduler& scheduler, std::string& strNodeError, Options c
|
||||
{
|
||||
nTotalBytesRecv = 0;
|
||||
nTotalBytesSent = 0;
|
||||
nMaxOutboundLimit = 0;
|
||||
nMaxOutboundTotalBytesSentInCycle = 0;
|
||||
nMaxOutboundTimeframe = 60*60*24; //1 day
|
||||
nMaxOutboundCycleStartTime = 0;
|
||||
|
||||
nRelevantServices = connOptions.nRelevantServices;
|
||||
@ -2167,6 +2165,9 @@ bool CConnman::Start(CScheduler& scheduler, std::string& strNodeError, Options c
|
||||
nSendBufferMaxSize = connOptions.nSendBufferMaxSize;
|
||||
nReceiveFloodSize = connOptions.nReceiveFloodSize;
|
||||
|
||||
nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
|
||||
nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe;
|
||||
|
||||
SetBestHeight(connOptions.nBestHeight);
|
||||
|
||||
clientInterface = connOptions.uiInterface;
|
||||
|
@ -80,6 +80,8 @@ static const size_t SETASKFOR_MAX_SZ = 2 * MAX_INV_SZ;
|
||||
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
|
||||
/** The default for -maxuploadtarget. 0 = Unlimited */
|
||||
static const uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;
|
||||
/** The default timeframe for -maxuploadtarget. 1 day. */
|
||||
static const uint64_t MAX_UPLOAD_TIMEFRAME = 60 * 60 * 24;
|
||||
/** Default for blocks only*/
|
||||
static const bool DEFAULT_BLOCKSONLY = false;
|
||||
|
||||
@ -128,6 +130,8 @@ public:
|
||||
CClientUIInterface* uiInterface = nullptr;
|
||||
unsigned int nSendBufferMaxSize = 0;
|
||||
unsigned int nReceiveFloodSize = 0;
|
||||
uint64_t nMaxOutboundTimeframe = 0;
|
||||
uint64_t nMaxOutboundLimit = 0;
|
||||
};
|
||||
CConnman();
|
||||
~CConnman();
|
||||
|
Loading…
Reference in New Issue
Block a user