Skip to content

Commit 98fab37

Browse files
committed
net: use peer=N instead of from=N in debug log
1 parent 1230210 commit 98fab37

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ bool CConnman::InactivityCheck(const CNode& node) const
12311231
}
12321232

12331233
if (node.nLastRecv == 0 || node.nLastSend == 0) {
1234-
LogPrint(BCLog::NET, "socket no message in first %i seconds, %d %d from %d\n", m_peer_connect_timeout, node.nLastRecv != 0, node.nLastSend != 0, node.GetId());
1234+
LogPrint(BCLog::NET, "socket no message in first %i seconds, %d %d peer=%d\n", m_peer_connect_timeout, node.nLastRecv != 0, node.nLastSend != 0, node.GetId());
12351235
return true;
12361236
}
12371237

@@ -1254,7 +1254,7 @@ bool CConnman::InactivityCheck(const CNode& node) const
12541254
}
12551255

12561256
if (!node.fSuccessfullyConnected) {
1257-
LogPrint(BCLog::NET, "version handshake timeout from %d\n", node.GetId());
1257+
LogPrint(BCLog::NET, "version handshake timeout peer=%d\n", node.GetId());
12581258
return true;
12591259
}
12601260

test/functional/p2p_timeouts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def run_test(self):
7474
no_version_node.send_message(msg_ping())
7575

7676
expected_timeout_logs = [
77-
"version handshake timeout from 0",
78-
"socket no message in first 3 seconds, 1 0 from 1",
79-
"socket no message in first 3 seconds, 0 0 from 2",
77+
"version handshake timeout peer=0",
78+
"socket no message in first 3 seconds, 1 0 peer=1",
79+
"socket no message in first 3 seconds, 0 0 peer=2",
8080
]
8181

8282
with self.nodes[0].assert_debug_log(expected_msgs=expected_timeout_logs):

0 commit comments

Comments
 (0)