diff options
| author | langerhans <[email protected]> | 2014-12-20 18:05:06 +0100 |
|---|---|---|
| committer | langerhans <[email protected]> | 2014-12-20 18:11:15 +0100 |
| commit | 93d0ddad73e05c318a980284bf601158a3ef0d02 (patch) | |
| tree | 2bbae1c875cfa6fb6f9c844ddba28156ec65a66a /src/init.cpp | |
| parent | Merge pull request #753 from langerhans/1.8.1-dev-blocknotify (diff) | |
| download | discoin-93d0ddad73e05c318a980284bf601158a3ef0d02.tar.xz discoin-93d0ddad73e05c318a980284bf601158a3ef0d02.zip | |
Introduce -maxoutconnections= to set the maximum number of outbound connections
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8223e3282..1737bb069 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -230,6 +230,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += " -externalip=<ip> " + _("Specify your own public address") + "\n"; strUsage += " -listen " + _("Accept connections from outside (default: 1 if no -proxy or -connect)") + "\n"; strUsage += " -maxconnections=<n> " + _("Maintain at most <n> connections to peers (default: 125)") + "\n"; + strUsage += " -maxoutconnections=<n> " + _("Maintain at most <n> outbound connections to peers (default: 8)") + "\n"; strUsage += " -maxreceivebuffer=<n> " + _("Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)") + "\n"; strUsage += " -maxsendbuffer=<n> " + _("Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)") + "\n"; strUsage += " -onion=<ip:port> " + _("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)") + "\n"; @@ -535,6 +536,8 @@ bool AppInit2(boost::thread_group& threadGroup) if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections) nMaxConnections = nFD - MIN_CORE_FILEDESCRIPTORS; + nMaxOutboundConnections = GetArg("-maxoutconnections", 8); + nMaxOutboundConnections = std::min(std::max(nMaxOutboundConnections, 2), nMaxConnections); // ********************************************************* Step 3: parameter-to-internal-flags fDebug = !mapMultiArgs["-debug"].empty(); |