net: additional disconnection logging

Use the word "disconnecting" everywhere for easier grep.
This commit is contained in:
Sjors Provoost
2024-07-23 10:53:15 +02:00
parent f7144b24be
commit ad224429f8
4 changed files with 49 additions and 18 deletions

View File

@@ -84,15 +84,15 @@ class TimeoutsTest(BitcoinTestFramework):
if self.options.v2transport:
expected_timeout_logs = [
"version handshake timeout peer=0",
"version handshake timeout peer=1",
"version handshake timeout peer=2",
"version handshake timeout, disconnecting peer=0",
"version handshake timeout, disconnecting peer=1",
"version handshake timeout, disconnecting peer=2",
]
else:
expected_timeout_logs = [
"version handshake timeout peer=0",
"socket no message in first 3 seconds, 1 0 peer=1",
"socket no message in first 3 seconds, 0 0 peer=2",
"version handshake timeout, disconnecting peer=0",
"socket no message in first 3 seconds, 1 0, disconnecting peer=1",
"socket no message in first 3 seconds, 0 0, disconnecting peer=2",
]
with self.nodes[0].assert_debug_log(expected_msgs=expected_timeout_logs):

View File

@@ -151,7 +151,7 @@ class EncryptedP2PMisbehaving(BitcoinTestFramework):
# Ensure that the bytes sent after 4 bytes network magic are actually received.
self.wait_until(lambda: node0.getpeerinfo()[-1]["bytesrecv"] > 4)
self.wait_until(lambda: node0.getpeerinfo()[-1]["bytessent"] > 0)
with node0.assert_debug_log(['V2 handshake timeout peer=0']):
with node0.assert_debug_log(['V2 handshake timeout, disconnecting peer=0']):
node0.bumpmocktime(4) # `InactivityCheck()` triggers now
peer1.wait_for_disconnect(timeout=1)
self.log.info('successful disconnection since modified ellswift was sent as response')
@@ -162,7 +162,7 @@ class EncryptedP2PMisbehaving(BitcoinTestFramework):
expected_debug_message = [
[], # EARLY_KEY_RESPONSE
["V2 transport error: missing garbage terminator, peer=1"], # EXCESS_GARBAGE
["V2 handshake timeout peer=3"], # WRONG_GARBAGE_TERMINATOR
["V2 handshake timeout, disconnecting peer=3"], # WRONG_GARBAGE_TERMINATOR
["V2 transport error: packet decryption failure"], # WRONG_GARBAGE
["V2 transport error: packet decryption failure"], # SEND_NO_AAD
[], # SEND_NON_EMPTY_VERSION_PACKET