net: use peer=N instead of from=N in debug log

pull/826/head
Anthony Towns 4 years ago
parent 12302105bb
commit 98fab37ca0

@ -1231,7 +1231,7 @@ bool CConnman::InactivityCheck(const CNode& node) const
} }
if (node.nLastRecv == 0 || node.nLastSend == 0) { if (node.nLastRecv == 0 || node.nLastSend == 0) {
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()); 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());
return true; return true;
} }
@ -1254,7 +1254,7 @@ bool CConnman::InactivityCheck(const CNode& node) const
} }
if (!node.fSuccessfullyConnected) { if (!node.fSuccessfullyConnected) {
LogPrint(BCLog::NET, "version handshake timeout from %d\n", node.GetId()); LogPrint(BCLog::NET, "version handshake timeout peer=%d\n", node.GetId());
return true; return true;
} }

@ -74,9 +74,9 @@ class TimeoutsTest(BitcoinTestFramework):
no_version_node.send_message(msg_ping()) no_version_node.send_message(msg_ping())
expected_timeout_logs = [ expected_timeout_logs = [
"version handshake timeout from 0", "version handshake timeout peer=0",
"socket no message in first 3 seconds, 1 0 from 1", "socket no message in first 3 seconds, 1 0 peer=1",
"socket no message in first 3 seconds, 0 0 from 2", "socket no message in first 3 seconds, 0 0 peer=2",
] ]
with self.nodes[0].assert_debug_log(expected_msgs=expected_timeout_logs): with self.nodes[0].assert_debug_log(expected_msgs=expected_timeout_logs):

Loading…
Cancel
Save