aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-12-31 02:05:11 -0500
committerCory Fields <cory-nospam-@coryfields.com>2017-01-04 09:29:14 -0500
commitf6315e07f9383f3f43e37ada0d6a835810d610b9 (patch)
tree86bc02305e6139563197f2bb120172767465bb2c /src/net.cpp
parent5b4a8ac6d6b4d8e17b448f2b4927025fb352f7af (diff)
net: only disconnect if fDisconnect has been set
These conditions are problematic to check without locking, and we shouldn't be relying on the refcount to disconnect.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 3478d04a7e..65f1c62ad6 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1051,8 +1051,7 @@ void CConnman::ThreadSocketHandler()
std::vector<CNode*> vNodesCopy = vNodes;
BOOST_FOREACH(CNode* pnode, vNodesCopy)
{
- if (pnode->fDisconnect ||
- (pnode->GetRefCount() <= 0 && pnode->vRecvMsg.empty() && pnode->nSendSize == 0))
+ if (pnode->fDisconnect)
{
// remove from vNodes
vNodes.erase(remove(vNodes.begin(), vNodes.end(), pnode), vNodes.end());