Skip to content

Commit

Permalink
Still invoke ReleaseNodeVector when interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Apr 17, 2020
1 parent f8ccbef commit 9c2cd80
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ void CConnman::SocketHandler()
for (CNode* pnode : vErrorNodes)
{
if (interruptNet) {
return;
break;
}
// let recv() return errors and then handle it
SocketRecvData(pnode);
Expand All @@ -1671,7 +1671,7 @@ void CConnman::SocketHandler()
for (CNode* pnode : vReceivableNodes)
{
if (interruptNet) {
return;
break;
}
if (pnode->fPauseRecv) {
continue;
Expand All @@ -1682,7 +1682,7 @@ void CConnman::SocketHandler()

for (CNode* pnode : vSendableNodes) {
if (interruptNet) {
return;
break;
}

LOCK(pnode->cs_vSend);
Expand All @@ -1696,6 +1696,10 @@ void CConnman::SocketHandler()
ReleaseNodeVector(vReceivableNodes);
ReleaseNodeVector(vSendableNodes);

if (interruptNet) {
return;
}

{
LOCK(cs_vNodes);
// remove nodes from mapSendableNodes, so that the next iteration knows that there is no work to do
Expand Down

0 comments on commit 9c2cd80

Please sign in to comment.