aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <[email protected]>2014-04-09 09:25:52 -0700
committerGregory Maxwell <[email protected]>2014-04-09 09:30:36 -0700
commitd20791b0e524bb1834ec7776acf0dec84c24861b (patch)
tree7486f89c07373927ea652406d0ebefa01c77bb5f /src/net.cpp
parentMerge pull request #4024 (diff)
downloaddiscoin-d20791b0e524bb1834ec7776acf0dec84c24861b.tar.xz
discoin-d20791b0e524bb1834ec7776acf0dec84c24861b.zip
Prevent socket leak in ThreadSocketHandler.
When we are over our outbound limit ThreadSocketHandler would try to keep the connection if the peer was addnoded. This didn't actually work for two reasons: It didn't actually run the accept code due to mistaken code flow, and because we have a limited number of outbound semaphores it couldn't actually use the connection. Instead it leaked the socket, which might have caused issue #4034. This patch just takes out the non-functioning white-listing for now.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 657a39bcf..a0208c960 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -946,11 +946,7 @@ void ThreadSocketHandler()
}
else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS)
{
- {
- LOCK(cs_setservAddNodeAddresses);
- if (!setservAddNodeAddresses.count(addr))
- closesocket(hSocket);
- }
+ closesocket(hSocket);
}
else if (CNode::IsBanned(addr))
{