Skip to content

Commit

Permalink
net, refactor: Fix style in CConnman::StopNodes
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Apr 22, 2021
1 parent 229ac18 commit 8c8237a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2644,10 +2644,13 @@ void CConnman::StopNodes()
}

// Close listening sockets.
for (ListenSocket& hListenSocket : vhListenSocket)
if (hListenSocket.socket != INVALID_SOCKET)
if (!CloseSocket(hListenSocket.socket))
for (ListenSocket& hListenSocket : vhListenSocket) {
if (hListenSocket.socket != INVALID_SOCKET) {
if (!CloseSocket(hListenSocket.socket)) {
LogPrintf("CloseSocket(hListenSocket) failed with error %s\n", NetworkErrorString(WSAGetLastError()));
}
}
}

for (CNode* pnode : vNodesDisconnected) {
DeleteNode(pnode);
Expand Down

0 comments on commit 8c8237a

Please sign in to comment.