Browse Source

[net] Remove assert(nMaxInbound > 0)

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: #9008
Rebased-From: fa1c3c2eb0
0.13
MarcoFalke 8 years ago committed by Wladimir J. van der Laan
parent
commit
58d4fa7da3
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 1
      src/net.cpp

1
src/net.cpp

@ -1021,7 +1021,6 @@ static void AcceptConnection(const ListenSocket& hListenSocket) { @@ -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))

Loading…
Cancel
Save