mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
[test] Move MY_VERSION 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 MY_VERSION to p2p.py. Also rename to P2P_VERSION to distinguish it from other versioning used in Bitcoin/Bitcoin Core. Also always set the nVersion field in CBlockLocator to 0 and ignore the field in deserialized messages. The field is not currently used for anything in Bitcoin Core.
This commit is contained in:
@ -80,6 +80,9 @@ logger = logging.getLogger("TestFramework.p2p")
|
||||
|
||||
# The minimum P2P version that this test framework supports
|
||||
MIN_P2P_VERSION_SUPPORTED = 60001
|
||||
# The P2P version that this test framework implements and sends in its `version` message
|
||||
# Version 70016 supports wtxid relay
|
||||
P2P_VERSION = 70016
|
||||
|
||||
MESSAGEMAP = {
|
||||
b"addr": msg_addr,
|
||||
@ -329,6 +332,7 @@ class P2PInterface(P2PConnection):
|
||||
def peer_connect_send_version(self, services):
|
||||
# Send a version msg
|
||||
vt = msg_version()
|
||||
vt.nVersion = P2P_VERSION
|
||||
vt.nServices = services
|
||||
vt.addrTo.ip = self.dstaddr
|
||||
vt.addrTo.port = self.dstport
|
||||
|
Reference in New Issue
Block a user