Skip to content

Commit 28d0f22

Browse files
TheBlueMattluke-jr
authored andcommitted
Fix calculation of number of bound sockets to use
Github-Pull: #9253 Rebased-From: 9e1f468
1 parent 396c405 commit 28d0f22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/init.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
854854
}
855855

856856
// Make sure enough file descriptors are available
857-
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
857+
int nBind = std::max(
858+
(mapMultiArgs.count("-bind") ? mapMultiArgs.at("-bind").size() : 0) +
859+
(mapMultiArgs.count("-whitebind") ? mapMultiArgs.at("-whitebind").size() : 0), size_t(1));
858860
int nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
859861
nMaxConnections = std::max(nUserMaxConnections, 0);
860862

0 commit comments

Comments
 (0)