@@ -815,7 +815,7 @@ size_t CConnman::SocketSendData(CNode& node) const
815
815
// error
816
816
int nErr = WSAGetLastError ();
817
817
if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS) {
818
- LogPrintf ( " socket send error % s\n " , NetworkErrorString (nErr));
818
+ LogPrint (BCLog::NET, " socket send error for peer=%d: % s\n " , node. GetId () , NetworkErrorString (nErr));
819
819
node.CloseSocketDisconnect ();
820
820
}
821
821
}
@@ -1053,7 +1053,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
1053
1053
}
1054
1054
1055
1055
if (!fNetworkActive ) {
1056
- LogPrintf ( " connection from %s dropped: not accepting new connections\n " , addr.ToString ());
1056
+ LogPrint (BCLog::NET, " connection from %s dropped: not accepting new connections\n " , addr.ToString ());
1057
1057
CloseSocket (hSocket);
1058
1058
return ;
1059
1059
}
@@ -1236,20 +1236,20 @@ bool CConnman::InactivityCheck(const CNode& node) const
1236
1236
}
1237
1237
1238
1238
if (now > node.nLastSend + TIMEOUT_INTERVAL) {
1239
- LogPrintf ( " socket sending timeout: %is\n " , now - node.nLastSend );
1239
+ LogPrint (BCLog::NET, " socket sending timeout: %is peer=%d \n " , now - node.nLastSend , node. GetId () );
1240
1240
return true ;
1241
1241
}
1242
1242
1243
1243
if (now > node.nLastRecv + TIMEOUT_INTERVAL) {
1244
- LogPrintf ( " socket receive timeout: %is\n " , now - node.nLastRecv );
1244
+ LogPrint (BCLog::NET, " socket receive timeout: %is peer=%d \n " , now - node.nLastRecv , node. GetId () );
1245
1245
return true ;
1246
1246
}
1247
1247
1248
1248
if (node.nPingNonceSent && node.m_ping_start .load () + std::chrono::seconds{TIMEOUT_INTERVAL} < GetTime<std::chrono::microseconds>()) {
1249
1249
// We use mockable time for ping timeouts. This means that setmocktime
1250
1250
// may cause pings to time out for peers that have been connected for
1251
1251
// longer than m_peer_connect_timeout.
1252
- LogPrintf ( " ping timeout: %fs\n " , 0.000001 * count_microseconds (GetTime<std::chrono::microseconds>() - node.m_ping_start .load ()));
1252
+ LogPrint (BCLog::NET, " ping timeout: %fs peer=%d \n " , 0.000001 * count_microseconds (GetTime<std::chrono::microseconds>() - node.m_ping_start .load ()), node. GetId ( ));
1253
1253
return true ;
1254
1254
}
1255
1255
0 commit comments