From da7f70a5322843b70f29456a8bc2227209a0718b Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 26 Jan 2026 12:55:31 +0100 Subject: [PATCH] test: use port 0 for I2P addresses in p2p_private_broadcast.py I2P addresses must use port=0, otherwise `bitcoind` refuses to connect. The test `p2p_private_broadcast.py` cannot simulate connections to I2P peers, so the I2P proxy is set to a dummy `127.0.0.1:1`. Still it is good to pick I2P addresses and attempt connections to increase coverage. However the test uses port=8333 for I2P addresses and thus the connection attempts fail for the "wrong" reason: ``` Error connecting to ...i2p:8333, connection refused due to arbitrary port 8333 ``` Using the proper port=0 makes the failures: ``` Error connecting to ...i2p:0: Cannot connect to 127.0.0.1:1 ``` which will make possible simulated I2P connections once we have a test I2P proxy. --- test/functional/p2p_private_broadcast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/p2p_private_broadcast.py b/test/functional/p2p_private_broadcast.py index 07c6dc97569..a4d2beac096 100755 --- a/test/functional/p2p_private_broadcast.py +++ b/test/functional/p2p_private_broadcast.py @@ -355,7 +355,7 @@ class P2PPrivateBroadcast(BitcoinTestFramework): # Fill tx_originator's addrman. for addr in ADDRMAN_ADDRESSES: - res = tx_originator.addpeeraddress(address=addr, port=8333, tried=False) + res = tx_originator.addpeeraddress(address=addr, port=0 if addr.endswith(".i2p") else 8333, tried=False) if not res["success"]: self.log.debug(f"Could not add {addr} to tx_originator's addrman (collision?)")