aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-11-29 17:49:08 -0800
committerLuke Dashjr <luke-jr+git@utopios.org>2016-12-02 07:53:40 +0000
commit28d0f224fda3ec375c07aaa18f786ce18f674f29 (patch)
tree84ba20a58fbeeaac1b32df2564a5b2893b6c4ab3
parent396c405e7b4911eea3eceecd001840ffa8c38e95 (diff)
downloadbitcoin-28d0f224fda3ec375c07aaa18f786ce18f674f29.tar.xz
Fix calculation of number of bound sockets to use
Github-Pull: #9253 Rebased-From: 9e1f46821d5bb69e2cbf25738eefa7c6cb99c838
-rw-r--r--src/init.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index eab8de8d02..4a837018b1 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -854,7 +854,9 @@ 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 nBind = std::max(
+ (mapMultiArgs.count("-bind") ? mapMultiArgs.at("-bind").size() : 0) +
+ (mapMultiArgs.count("-whitebind") ? mapMultiArgs.at("-whitebind").size() : 0), size_t(1));
int nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
nMaxConnections = std::max(nUserMaxConnections, 0);