mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 02:31:05 +02:00
[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.
This commit is contained in:
@ -85,6 +85,8 @@ MIN_P2P_VERSION_SUPPORTED = 60001
|
||||
P2P_VERSION = 70016
|
||||
# The P2P user agent string that this test framework sends in its `version` message
|
||||
P2P_SUBVERSION = "/python-p2p-tester:0.0.3/"
|
||||
# Value for relay that this test framework sends in its `version` message
|
||||
P2P_VERSION_RELAY = 1
|
||||
|
||||
MESSAGEMAP = {
|
||||
b"addr": msg_addr,
|
||||
@ -336,6 +338,7 @@ class P2PInterface(P2PConnection):
|
||||
vt = msg_version()
|
||||
vt.nVersion = P2P_VERSION
|
||||
vt.strSubVer = P2P_SUBVERSION
|
||||
vt.relay = P2P_VERSION_RELAY
|
||||
vt.nServices = services
|
||||
vt.addrTo.ip = self.dstaddr
|
||||
vt.addrTo.port = self.dstport
|
||||
|
Reference in New Issue
Block a user