diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index eddab3da37..b505dfc4bf 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -1412,7 +1412,7 @@ class FullBlockTest(BitcoinTestFramework): """Add a P2P connection to the node. Helper to connect and wait for version handshake.""" - self.helper_peer = self.nodes[0].add_p2p_connection(P2PDataStore(), node_outgoing=True) + self.helper_peer = self.nodes[0].add_outbound_p2p_connection(P2PDataStore(), p2p_idx=0) # We need to wait for the initial getheaders from the peer before we # start populating our blockstore. If we don't, then we may run ahead # to the next subtest before we receive the getheaders. We'd then send diff --git a/test/functional/p2p_dos_header_tree.py b/test/functional/p2p_dos_header_tree.py index fd45c0be52..95ca65d566 100755 --- a/test/functional/p2p_dos_header_tree.py +++ b/test/functional/p2p_dos_header_tree.py @@ -47,7 +47,7 @@ class RejectLowDifficultyHeadersTest(BitcoinTestFramework): self.headers_fork = [from_hex(CBlockHeader(), h) for h in self.headers_fork] self.log.info("Feed all non-fork headers, including and up to the first checkpoint") - peer_checkpoint = self.nodes[0].add_p2p_connection(P2PInterface(), node_outgoing=True) + peer_checkpoint = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=0) peer_checkpoint.send_and_ping(msg_headers(self.headers)) assert { 'height': 546, @@ -64,7 +64,7 @@ class RejectLowDifficultyHeadersTest(BitcoinTestFramework): self.log.info("Feed all fork headers (succeeds without checkpoint)") # On node 0 it succeeds because checkpoints are disabled self.restart_node(0, extra_args=['-nocheckpoints', "-minimumchainwork=0x0", '-prune=550']) - peer_no_checkpoint = self.nodes[0].add_p2p_connection(P2PInterface(), node_outgoing=True) + peer_no_checkpoint = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=0) peer_no_checkpoint.send_and_ping(msg_headers(self.headers_fork)) assert { "height": 2, @@ -74,7 +74,7 @@ class RejectLowDifficultyHeadersTest(BitcoinTestFramework): } in self.nodes[0].getchaintips() # On node 1 it succeeds because no checkpoint has been reached yet by a chain tip - peer_before_checkpoint = self.nodes[1].add_p2p_connection(P2PInterface(), node_outgoing=True) + peer_before_checkpoint = self.nodes[1].add_outbound_p2p_connection(P2PInterface(), p2p_idx=1) peer_before_checkpoint.send_and_ping(msg_headers(self.headers_fork)) assert { "height": 2, diff --git a/test/functional/p2p_invalid_tx.py b/test/functional/p2p_invalid_tx.py index efee1a14b2..8aec5e3459 100755 --- a/test/functional/p2p_invalid_tx.py +++ b/test/functional/p2p_invalid_tx.py @@ -33,8 +33,8 @@ class InvalidTxRequestTest(BitcoinTestFramework): """Add a P2P connection to the node. Helper to connect and wait for version handshake.""" - for _ in range(num_connections): - self.nodes[0].add_p2p_connection(P2PDataStore(), node_outgoing=True) + for i in range(num_connections): + self.nodes[0].add_outbound_p2p_connection(P2PDataStore(), p2p_idx=i) def reconnect_p2p(self, **kwargs): """Tear down and bootstrap the P2P connection to the node. diff --git a/test/functional/p2p_unrequested_blocks.py b/test/functional/p2p_unrequested_blocks.py index d487b26711..d96be42d4f 100755 --- a/test/functional/p2p_unrequested_blocks.py +++ b/test/functional/p2p_unrequested_blocks.py @@ -80,7 +80,7 @@ class AcceptBlockTest(BitcoinTestFramework): return False def run_test(self): - test_node = self.nodes[0].add_p2p_connection(P2PInterface(), node_outgoing=True) + test_node = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=0) min_work_node = self.nodes[1].add_p2p_connection(P2PInterface()) # 1. Have nodes mine a block (leave IBD) @@ -203,7 +203,7 @@ class AcceptBlockTest(BitcoinTestFramework): self.nodes[0].disconnect_p2ps() self.nodes[1].disconnect_p2ps() - test_node = self.nodes[0].add_p2p_connection(P2PInterface(), node_outgoing=True) + test_node = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=2) test_node.send_and_ping(msg_block(block_h1f)) assert_equal(self.nodes[0].getblockcount(), 2) @@ -275,7 +275,7 @@ class AcceptBlockTest(BitcoinTestFramework): test_node.wait_for_disconnect() self.nodes[0].disconnect_p2ps() - test_node = self.nodes[0].add_p2p_connection(P2PInterface(), node_outgoing=True) + test_node = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=3) # We should have failed reorg and switched back to 290 (but have block 291) assert_equal(self.nodes[0].getblockcount(), 290)