aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-05-22 09:52:03 +0200
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:24:06 -0400
commitfdf69ff21aef8ed8071a757979f4239537f7afba (patch)
tree638189832dc1ea475da4747811cdbbc1d4ce4de5 /src/init.cpp
parent8a593694b1495656411717fbae5d3167576df973 (diff)
net: move max/max-outbound to CConnman
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 644d6721e4..599dac39b2 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -861,7 +861,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// Make sure enough file descriptors are available
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
int nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
- nMaxConnections = std::max(nUserMaxConnections, 0);
+ int nMaxConnections = std::max(nUserMaxConnections, 0);
// Trim requested connection counts, to fit into system limitations
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
@@ -1509,7 +1509,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
StartTorControl(threadGroup, scheduler);
std::string strNodeError;
- if(!StartNode(connman, threadGroup, scheduler, nLocalServices, nRelevantServices, strNodeError))
+ int nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections);
+ if(!StartNode(connman, threadGroup, scheduler, nLocalServices, nRelevantServices, nMaxConnections, nMaxOutbound, strNodeError))
return InitError(strNodeError);
// ********************************************************* Step 12: finished