net_processing: use CNode::DisconnectMsg helper

This is not a pure refactor:
1. It slightly changes the log messages, as reflected in the test changes
2. It adds the IP address to all disconnect logging (when fLogIPs is set)
This commit is contained in:
Sjors Provoost committed 2024-11-26 13:22:55 +01:00
1 parent ad224429f8
commit 937ef9eb40
5 files changed
+53 -50

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ class AddrTest(BitcoinTestFramework):
def run_test(self):
self.log.info('Check disconnection when sending sendaddrv2 after verack')
conn = self.nodes[0].add_p2p_connection(P2PInterface())
with self.nodes[0].assert_debug_log(['sendaddrv2 received after verack from peer=0; disconnecting']):
with self.nodes[0].assert_debug_log(['sendaddrv2 received after verack, disconnecting peer=0']):
conn.send_message(msg_sendaddrv2())
conn.wait_for_disconnect()