diff options
| author | Cory Fields <[email protected]> | 2016-12-31 02:05:11 -0500 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2017-01-04 09:29:14 -0500 |
| commit | f6315e07f9383f3f43e37ada0d6a835810d610b9 (patch) | |
| tree | 86bc02305e6139563197f2bb120172767465bb2c /src/net.cpp | |
| parent | net: make GetReceiveFloodSize public (diff) | |
| download | discoin-f6315e07f9383f3f43e37ada0d6a835810d610b9.tar.xz discoin-f6315e07f9383f3f43e37ada0d6a835810d610b9.zip | |
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.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index 3478d04a7..65f1c62ad 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()); |