mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 00:10:44 +01:00
[test] Move MY_SUBVERSION 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_SUBVERSION to p2p.py. Also rename to P2P_SUBVERSION.
This commit is contained in:
@@ -23,7 +23,7 @@ import sys
|
||||
|
||||
from .authproxy import JSONRPCException
|
||||
from .descriptors import descsum_create
|
||||
from .messages import MY_SUBVERSION
|
||||
from .p2p import P2P_SUBVERSION
|
||||
from .util import (
|
||||
MAX_NODES,
|
||||
append_config,
|
||||
@@ -572,7 +572,7 @@ class TestNode():
|
||||
|
||||
def num_test_p2p_connections(self):
|
||||
"""Return number of test framework p2p connections to the node."""
|
||||
return len([peer for peer in self.getpeerinfo() if peer['subver'] == MY_SUBVERSION])
|
||||
return len([peer for peer in self.getpeerinfo() if peer['subver'] == P2P_SUBVERSION])
|
||||
|
||||
def disconnect_p2ps(self):
|
||||
"""Close all p2p connections to the node."""
|
||||
|
||||
Reference in New Issue
Block a user