Skip to content

Commit c1a5227

Browse files
committed
Merge #9253: Fix calculation of number of bound sockets to use
9e1f468 Fix calculation of number of bound sockets to use (Matt Corallo)
2 parents c79e52a + 9e1f468 commit c1a5227

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
@@ -859,7 +859,9 @@ bool AppInitParameterInteraction()
859859
}
860860

861861
// Make sure enough file descriptors are available
862-
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
862+
int nBind = std::max(
863+
(mapMultiArgs.count("-bind") ? mapMultiArgs.at("-bind").size() : 0) +
864+
(mapMultiArgs.count("-whitebind") ? mapMultiArgs.at("-whitebind").size() : 0), size_t(1));
863865
nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
864866
nMaxConnections = std::max(nUserMaxConnections, 0);
865867

0 commit comments

Comments
 (0)