net, refactor: Fix style in CConnman::StopNodes

This commit is contained in:
Hennadii Stepanov 2021-04-22 17:30:35 +03:00
parent 229ac1892d
commit 8c8237a4a1
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -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);