mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
test: set P2PConnection.p2p_connected_to_node in peer_connect_helper()
Set `P2PConnection.p2p_connected_to_node` in `P2PConnection.peer_connect_helper()` instead of `TestNode.add_p2p_connection()` and `TestNode.add_outbound_p2p_connection()`. This way tests can create an instance of `P2PConnection` and use `P2PConnection.peer_connect_helper()` directly.
This commit is contained in:
@@ -714,7 +714,6 @@ class TestNode():
|
||||
if supports_v2_p2p is None:
|
||||
supports_v2_p2p = self.use_v2transport
|
||||
|
||||
p2p_conn.p2p_connected_to_node = True
|
||||
if self.use_v2transport:
|
||||
kwargs['services'] = kwargs.get('services', P2P_SERVICES) | NODE_P2P_V2
|
||||
supports_v2_p2p = self.use_v2transport and supports_v2_p2p
|
||||
@@ -781,7 +780,6 @@ class TestNode():
|
||||
self.log.debug("Connecting to %s:%d %s" % (address, port, connection_type))
|
||||
self.addconnection('%s:%d' % (address, port), connection_type, advertise_v2_p2p)
|
||||
|
||||
p2p_conn.p2p_connected_to_node = False
|
||||
if supports_v2_p2p is None:
|
||||
supports_v2_p2p = self.use_v2transport
|
||||
if advertise_v2_p2p is None:
|
||||
|
||||
Reference in New Issue
Block a user