Skip to content

Commit ea54ba2

Browse files
committed
[test] Fix port collisions caused by p2p_getaddr_caching.py
1 parent f9682e7 commit ea54ba2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/functional/p2p_getaddr_caching.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
from test_framework.test_framework import BitcoinTestFramework
1515
from test_framework.util import (
1616
assert_equal,
17-
PORT_MIN,
18-
PORT_RANGE,
17+
p2p_port,
1918
)
2019

2120
# As defined in net_processing.
@@ -44,10 +43,9 @@ def addr_received(self):
4443
class AddrTest(BitcoinTestFramework):
4544
def set_test_params(self):
4645
self.num_nodes = 1
47-
# Start onion ports after p2p and rpc ports.
48-
port = PORT_MIN + 2 * PORT_RANGE
49-
self.onion_port1 = port
50-
self.onion_port2 = port + 1
46+
# Use some of the remaining p2p ports for the onion binds.
47+
self.onion_port1 = p2p_port(1)
48+
self.onion_port2 = p2p_port(2)
5149
self.extra_args = [
5250
[f"-bind=127.0.0.1:{self.onion_port1}=onion", f"-bind=127.0.0.1:{self.onion_port2}=onion"],
5351
]

0 commit comments

Comments
 (0)