aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/p2p.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:00:24 +0000
commit652311165c4ef298dab71d7162f9054abf439f77 (patch)
treebf5344575e2ea7c812cdc7b433ae4fc282eb25d8 /test/functional/test_framework/p2p.py
parent8639c446d88b5d521485dbec00029b3028d01492 (diff)
downloadbitcoin-652311165c4ef298dab71d7162f9054abf439f77.tar.xz
[test] Move MIN_VERSION_SUPPORTED to p2p.py
The messages.py module should contain code and helpers for [de]serializing p2p messages. Specific usage of those messages should be in p2p.py. Therefore move MIN_VERSION_SUPPORTED to p2p.py. Also rename to MIN_P2P_VERSION_SUPPORTED to distinguish it from other versioning used in Bitcoin/Bitcoin Core.
Diffstat (limited to 'test/functional/test_framework/p2p.py')
-rwxr-xr-xtest/functional/test_framework/p2p.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py
index fa4a567aac..befadc894f 100755
--- a/test/functional/test_framework/p2p.py
+++ b/test/functional/test_framework/p2p.py
@@ -31,7 +31,6 @@ import threading
from test_framework.messages import (
CBlockHeader,
MAX_HEADERS_RESULTS,
- MIN_VERSION_SUPPORTED,
msg_addr,
msg_addrv2,
msg_block,
@@ -79,6 +78,9 @@ from test_framework.util import (
logger = logging.getLogger("TestFramework.p2p")
+# The minimum P2P version that this test framework supports
+MIN_P2P_VERSION_SUPPORTED = 60001
+
MESSAGEMAP = {
b"addr": msg_addr,
b"addrv2": msg_addrv2,
@@ -417,7 +419,7 @@ class P2PInterface(P2PConnection):
pass
def on_version(self, message):
- assert message.nVersion >= MIN_VERSION_SUPPORTED, "Version {} received. Test framework only supports versions greater than {}".format(message.nVersion, MIN_VERSION_SUPPORTED)
+ assert message.nVersion >= MIN_P2P_VERSION_SUPPORTED, "Version {} received. Test framework only supports versions greater than {}".format(message.nVersion, MIN_P2P_VERSION_SUPPORTED)
if message.nVersion >= 70016 and self.wtxidrelay:
self.send_message(msg_wtxidrelay())
if self.support_addrv2: