From 180e379e2ddcb5a18a96ca2a6db073a8153e08cb Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 1 Dec 2016 13:03:56 -0800 Subject: [PATCH] Merge #9253: Fix calculation of number of bound sockets to use 9e1f468 Fix calculation of number of bound sockets to use (Matt Corallo) --- src/init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 93822167f..bb6808c2e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1018,7 +1018,9 @@ bool AppInitParameterInteraction() fAllowPrivateNet = GetBoolArg("-allowprivatenet", DEFAULT_ALLOWPRIVATENET); // 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)); nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS); nMaxConnections = std::max(nUserMaxConnections, 0);