[test] Add P2P_SERVICES 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 specify the nServices value in the calling code,
not in the messages.py module.
This commit is contained in:
John Newbery committed 2021-02-17 09:29:41 +00:00
1 parent 010542614d
commit 9ce4c3c4c1
4 files changed
+8 -2

No files matched your search

+2
View File
@@ -20,6 +20,7 @@ from test_framework.messages import (
from test_framework.p2p import (
P2PInterface,
P2P_SUBVERSION,
P2P_SERVICES,
P2P_VERSION_RELAY,
)
from test_framework.test_framework import BitcoinTestFramework
@@ -136,6 +137,7 @@ class P2PLeakTest(BitcoinTestFramework):
old_version_msg = msg_version()
old_version_msg.nVersion = 31799
old_version_msg.strSubVer = P2P_SUBVERSION
old_version_msg.nServices = P2P_SERVICES
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)