test: use port 0 for I2P addresses in p2p_private_broadcast.py
What changed, and why it matters
This is a minor fix to a Bitcoin Core test script. It changes the network port number used for I2P test addresses from 8333 to 0, because Bitcoin Core requires I2P addresses to use port 0. The change only affects an automated functional test and does not change production code, so it has no direct security impact on real Bitcoin nodes or users.
No security action required. Treat as a normal test-quality improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/p2p_private_broadcast.py so that addpeeraddress uses port 0 for .i2p addresses and 8333 for all other addresses. Previously the test always used port 8333, causing I2P connection attempts to fail with ‘connection refused due to arbitrary port 8333’ rather than the expected proxy-unreachable error. This is a test-correctness/coverage improvement only.
Changed components
test/functional/p2p_private_broadcast.pyInspect captured patch +1 / −1
diff --git a/test/functional/p2p_private_broadcast.py b/test/functional/p2p_private_broadcast.py
index 07c6dc97..a4d2beac 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?)")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.