diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2019-10-25 15:30:35 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2019-10-25 20:05:30 +0200 |
commit | 04dbdd613fe5c0a742de915e07553614cd4cbf46 (patch) | |
tree | 94e28b72ec4919870f3b2847742e64f3e43920fc | |
parent | 48cb468ce3f52195dfc64c6df88b8af36b77dbb0 (diff) |
[net] SocketHandler: log peer id for close and disconnect
-rw-r--r-- | src/net.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index c1c70facf4..c0b39925c6 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1361,7 +1361,7 @@ void CConnman::SocketHandler() { // socket closed gracefully if (!pnode->fDisconnect) { - LogPrint(BCLog::NET, "socket closed\n"); + LogPrint(BCLog::NET, "socket closed for peer=%d\n", pnode->GetId()); } pnode->CloseSocketDisconnect(); } @@ -1371,8 +1371,9 @@ void CConnman::SocketHandler() int nErr = WSAGetLastError(); if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) { - if (!pnode->fDisconnect) - LogPrintf("socket recv error %s\n", NetworkErrorString(nErr)); + if (!pnode->fDisconnect) { + LogPrint(BCLog::NET, "socket recv error for peer=%d: %s\n", pnode->GetId(), NetworkErrorString(nErr)); + } pnode->CloseSocketDisconnect(); } } |