aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_leak.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-11-28 11:41:25 +0000
committerJohn Newbery <john@johnnewbery.com>2021-02-17 09:23:32 +0000
commit010542614dbebba5f5ad6a58c0554930e9e214fc (patch)
treecd059d76169e95b298d729ba6acac7545f566449 /test/functional/p2p_leak.py
parent9b4054cb7af22123c7fcc4989e143606a630b2af (diff)
downloadbitcoin-010542614dbebba5f5ad6a58c0554930e9e214fc.tar.xz
[test] Move MY_RELAY to p2p.py
messages.py is for message and primitive data structures. Specifics about the test framework's p2p implementation should be in p2p.py. Also rename to P2P_VERSION_RELAY. Also rename msg_version.nRelay to relay. In Bitcoin Core, this is referred to as fRelay, since it's a bool, so this field has always been misnamed.
Diffstat (limited to 'test/functional/p2p_leak.py')
-rwxr-xr-xtest/functional/p2p_leak.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py
index 2cf327fc18..42e9b9f270 100755
--- a/test/functional/p2p_leak.py
+++ b/test/functional/p2p_leak.py
@@ -20,6 +20,7 @@ from test_framework.messages import (
from test_framework.p2p import (
P2PInterface,
P2P_SUBVERSION,
+ P2P_VERSION_RELAY,
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
@@ -128,13 +129,14 @@ class P2PLeakTest(BitcoinTestFramework):
assert_equal(ver.addrFrom.port, 0)
assert_equal(ver.addrFrom.ip, '0.0.0.0')
assert_equal(ver.nStartingHeight, 201)
- assert_equal(ver.nRelay, 1)
+ assert_equal(ver.relay, 1)
self.log.info('Check that old peers are disconnected')
p2p_old_peer = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False)
old_version_msg = msg_version()
old_version_msg.nVersion = 31799
old_version_msg.strSubVer = P2P_SUBVERSION
+ old_version_msg.relay = P2P_VERSION_RELAY
with self.nodes[0].assert_debug_log(['peer=3 using obsolete version 31799; disconnecting']):
p2p_old_peer.send_message(old_version_msg)
p2p_old_peer.wait_for_disconnect()