diff options
| author | Cory Fields <[email protected]> | 2016-09-12 15:04:20 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2016-09-14 13:14:04 -0400 |
| commit | f3552da81393a8e78ce3e2afed0b9c9d1ff5cee0 (patch) | |
| tree | 84ba797f7f67e1790d156b3425648249c446bcf2 /src/init.cpp | |
| parent | Merge #8714: [qa] gitignore: Remove unused lines (diff) | |
| download | discoin-f3552da81393a8e78ce3e2afed0b9c9d1ff5cee0.tar.xz discoin-f3552da81393a8e78ce3e2afed0b9c9d1ff5cee0.zip | |
net: fix maxuploadtarget setting
This was broken by 63cafa6329e1a.
Note that while this fixes the settings, it doesn't fix the actual usage of
-maxuploadtarget completely, as there is currently a bug in the
nOptimisticBytesWritten accounting that causes a delayed response if the target
is reached. That bug will be addressed separately.
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8d1e330a0..dd3fbf850 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1249,8 +1249,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) RegisterValidationInterface(pzmqNotificationInterface); } #endif + 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 @@ -1533,6 +1536,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(threadGroup, scheduler, strNodeError, connOptions)) return InitError(strNodeError); |