Skip to content

Commit 738d6b1

Browse files
MarcoFalkePastaPastaPasta
authored andcommitted
Merge bitcoin#19304: test: Check that message sends successfully when header is split across two buffers
80d4423 Test buffered valid message (Troy Giorshev) Pull request description: This PR is a tweak of bitcoin#19302. This sends a valid message. Additionally, this test includes logging in the same vein as bitcoin#19272. ACKs for top commit: MarcoFalke: tested ACK 80d4423 (added an assert(false) to observe deterministic coverage) 🌦 gzhao408: ACK bitcoin@80d4423 👊 Tree-SHA512: 3b1aa5ec480a1661917354788923d64595e2886448c9697ec0606a81293e8b4a4642b2b3cc9afb2206ce6f74e5c6d687308c5ad19cb73c5b354d3071ad8496f8
1 parent b292c41 commit 738d6b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/functional/p2p_invalid_messages.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test node responses to invalid network messages."""
6+
67
import struct
78
import sys
89

@@ -226,13 +227,13 @@ def test_command(self):
226227

227228
def test_large_inv(self):
228229
conn = self.nodes[0].add_p2p_connection(P2PInterface())
229-
with self.nodes[0].assert_debug_log(['Misbehaving', 'peer=5 (0 -> 20): message inv size() = 50001']):
230+
with self.nodes[0].assert_debug_log(['Misbehaving', '(0 -> 20): message inv size() = 50001']):
230231
msg = msg_inv([CInv(MSG_TX, 1)] * 50001)
231232
conn.send_and_ping(msg)
232-
with self.nodes[0].assert_debug_log(['Misbehaving', 'peer=5 (20 -> 40): message getdata size() = 50001']):
233+
with self.nodes[0].assert_debug_log(['Misbehaving', '(20 -> 40): message getdata size() = 50001']):
233234
msg = msg_getdata([CInv(MSG_TX, 1)] * 50001)
234235
conn.send_and_ping(msg)
235-
with self.nodes[0].assert_debug_log(['Misbehaving', 'peer=5 (40 -> 60): headers message size = 2001']):
236+
with self.nodes[0].assert_debug_log(['Misbehaving', '(40 -> 60): headers message size = 2001']):
236237
msg = msg_headers([CBlockHeader()] * 2001)
237238
conn.send_and_ping(msg)
238239
self.nodes[0].disconnect_p2ps()

0 commit comments

Comments
 (0)