Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-segwit-recovery.py
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | class SegwitRecoveryTest(BitcoinTestFramework): | ||||
def bootstrap_p2p(self, *, num_connections=1): | def bootstrap_p2p(self, *, num_connections=1): | ||||
"""Add a P2P connection to the node. | """Add a P2P connection to the node. | ||||
Helper to connect and wait for version handshake.""" | Helper to connect and wait for version handshake.""" | ||||
for node in self.nodes: | for node in self.nodes: | ||||
for _ in range(num_connections): | for _ in range(num_connections): | ||||
node.add_p2p_connection(P2PDataStore()) | node.add_p2p_connection(P2PDataStore()) | ||||
for node in self.nodes: | |||||
node.p2p.wait_for_verack() | |||||
def reconnect_p2p(self, **kwargs): | def reconnect_p2p(self, **kwargs): | ||||
"""Tear down and bootstrap the P2P connection to the node. | """Tear down and bootstrap the P2P connection to the node. | ||||
The node gets disconnected several times in this test. This helper | The node gets disconnected several times in this test. This helper | ||||
method reconnects the p2p and restarts the network thread.""" | method reconnects the p2p and restarts the network thread.""" | ||||
for node in self.nodes: | for node in self.nodes: | ||||
node.disconnect_p2ps() | node.disconnect_p2ps() | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |