From 010542614dbebba5f5ad6a58c0554930e9e214fc Mon Sep 17 00:00:00 2001 From: John Newbery Date: Sat, 28 Nov 2020 11:41:25 +0000 Subject: [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. --- test/functional/test_framework/messages.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'test/functional/test_framework/messages.py') diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index cee662aade..5170d430b7 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -31,8 +31,6 @@ import time from test_framework.siphash import siphash256 from test_framework.util import hex_str_to_bytes, assert_equal -MY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37) - MAX_LOCATOR_SZ = 101 MAX_BLOCK_BASE_SIZE = 1000000 MAX_BLOOM_FILTER_SIZE = 36000 @@ -1018,7 +1016,7 @@ class CMerkleBlock: # Objects that correspond to messages on the wire class msg_version: - __slots__ = ("addrFrom", "addrTo", "nNonce", "nRelay", "nServices", + __slots__ = ("addrFrom", "addrTo", "nNonce", "relay", "nServices", "nStartingHeight", "nTime", "nVersion", "strSubVer") msgtype = b"version" @@ -1031,7 +1029,7 @@ class msg_version: self.nNonce = random.getrandbits(64) self.strSubVer = '' self.nStartingHeight = -1 - self.nRelay = MY_RELAY + self.relay = 0 def deserialize(self, f): self.nVersion = struct.unpack("= 70001: # Relay field is optional for version 70001 onwards try: - self.nRelay = struct.unpack("