diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_anchors.py | 2 | ||||
-rwxr-xr-x | test/functional/test_framework/p2p.py | 8 | ||||
-rw-r--r-- | test/functional/test_framework/v2_p2p.py | 1 |
3 files changed, 5 insertions, 6 deletions
diff --git a/test/functional/feature_anchors.py b/test/functional/feature_anchors.py index 3b75a06d9e..5d68f50f58 100755 --- a/test/functional/feature_anchors.py +++ b/test/functional/feature_anchors.py @@ -99,7 +99,7 @@ class AnchorsTest(BitcoinTestFramework): self.restart_node(0, extra_args=[f"-onion={onion_conf.addr[0]}:{onion_conf.addr[1]}"]) self.log.info("Add 256-bit-address block-relay-only connections to node") - self.nodes[0].addconnection(ONION_ADDR, 'block-relay-only') + self.nodes[0].addconnection(ONION_ADDR, 'block-relay-only', v2transport=False) self.log.debug("Stop node") with self.nodes[0].assert_debug_log([f"DumpAnchors: Flush 1 outbound block-relay-only peer addresses to anchors.dat"]): diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py index ddb68dd4e2..dc04696114 100755 --- a/test/functional/test_framework/p2p.py +++ b/test/functional/test_framework/p2p.py @@ -242,7 +242,7 @@ class P2PConnection(asyncio.Protocol): self.on_close() # v2 handshake method - def v2_handshake(self): + def _on_data_v2_handshake(self): """v2 handshake performed before P2P messages are exchanged (see BIP324). P2PConnection is the initiator (in inbound connections to TestNode) and the responder (in outbound connections from TestNode). Performed by: @@ -298,7 +298,7 @@ class P2PConnection(asyncio.Protocol): if len(t) > 0: self.recvbuf += t if self.supports_v2_p2p and not self.v2_state.tried_v2_handshake: - self.v2_handshake() + self._on_data_v2_handshake() else: self._on_data() @@ -595,9 +595,7 @@ class P2PInterface(P2PConnection): def wait_for_reconnect(self, timeout=60): def test_function(): - if not (self.is_connected and self.last_message.get('version') and self.v2_state is None): - return False - return True + return self.is_connected and self.last_message.get('version') and not self.supports_v2_p2p self.wait_until(test_function, timeout=timeout, check_connected=False) # Message receiving helper methods diff --git a/test/functional/test_framework/v2_p2p.py b/test/functional/test_framework/v2_p2p.py index 0b3979fba2..8f79623bd8 100644 --- a/test/functional/test_framework/v2_p2p.py +++ b/test/functional/test_framework/v2_p2p.py @@ -220,6 +220,7 @@ class EncryptedP2PState: # decoy packets have contents = None. v2 handshake is complete only when version packet # (can be empty with contents = b"") with contents != None is received. if contents is not None: + assert contents == b"" # currently TestNode sends an empty version packet self.tried_v2_handshake = True return processed_length, True response = response[length:] |