Skip to content

Commit

Permalink
Fix calculation of number of bound sockets to use
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#9253
Rebased-From: 9e1f468
  • Loading branch information
TheBlueMatt authored and luke-jr committed Dec 2, 2016
1 parent 396c405 commit 28d0f22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/init.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 28d0f22

Please sign in to comment.