aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_sendtxrcncl.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2024-01-30 04:34:43 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2024-02-01 13:33:23 +0100
commitc340503b67585b631909584f1acaa327f5af25d3 (patch)
treeed81146cdf412cbd6479a54e9ea11228e8d79dd8 /test/functional/p2p_sendtxrcncl.py
parent7ddfc28309e6b70c273112a93f01e518409ceaa0 (diff)
downloadbitcoin-c340503b67585b631909584f1acaa327f5af25d3.tar.xz
test: p2p: adhere to typical VERSION message protocol flow
The test framework's p2p implementation currently sends out it's VERSION message immediately after an inbound connection (i.e. TestNode outbound connection) is made. This doesn't follow the usual protocol flow where the initiator sends a version first, and the responders processes that and only then responds with its own version message. Change that accordingly by only sending immediate VERSION message for outbound connections (or after v2 handshake for v2 connections, respectively), and sending out VERSION messages as response for incoming VERSION messages (i.e. in the function `on_version`) for inbound connections. Note that some of the overruled `on_version` methods in functional tests needed to be changed to send the version explicitly.
Diffstat (limited to 'test/functional/p2p_sendtxrcncl.py')
-rwxr-xr-xtest/functional/p2p_sendtxrcncl.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/p2p_sendtxrcncl.py b/test/functional/p2p_sendtxrcncl.py
index 0e349ef70c..8f5e6c0387 100755
--- a/test/functional/p2p_sendtxrcncl.py
+++ b/test/functional/p2p_sendtxrcncl.py
@@ -29,6 +29,7 @@ class PeerNoVerack(P2PInterface):
# Avoid sending verack in response to version.
# When calling add_p2p_connection, wait_for_verack=False must be set (see
# comment in add_p2p_connection).
+ self.send_version()
if message.nVersion >= 70016 and self.wtxidrelay:
self.send_message(msg_wtxidrelay())
@@ -43,7 +44,8 @@ class SendTxrcnclReceiver(P2PInterface):
class P2PFeelerReceiver(SendTxrcnclReceiver):
def on_version(self, message):
- pass # feeler connections can not send any message other than their own version
+ # feeler connections can not send any message other than their own version
+ self.send_version()
class PeerTrackMsgOrder(P2PInterface):