Skip to content

Commit

Permalink
[net] Remove assert(nMaxInbound > 0)
Browse files Browse the repository at this point in the history
nMaxInbound might very well be 0 or -1, if the user prefers to keep
a small number of maxconnections.

Note: nMaxInbound of -1 means that the user set maxconnections
to 8 or less, but we still want to keep an additional slot for
the feeler connection.

Github-Pull: bitcoin#9008
Rebased-From: fa1c3c2
  • Loading branch information
MarcoFalke authored and laanwj committed Oct 25, 2016
1 parent cb69988 commit 58d4fa7
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,6 @@ static void AcceptConnection(const ListenSocket& hListenSocket) {
CAddress addr;
int nInbound = 0;
int nMaxInbound = nMaxConnections - (MAX_OUTBOUND_CONNECTIONS + MAX_FEELER_CONNECTIONS);
assert(nMaxInbound > 0);

if (hSocket != INVALID_SOCKET)
if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr))
Expand Down

0 comments on commit 58d4fa7

Please sign in to comment.