Skip to content

Commit

Permalink
test: Add explicit onion bind to p2p_permissions
Browse files Browse the repository at this point in the history
When the bind option is replaced in the bitcoin.conf, bitcoind will
attempd to bind to the default tor listening port. If another bitcoind
is running that is already bound to that port, the bind will fail which,
since bitcoin#22729, causes the test to fail.
  • Loading branch information
achow101 committed Sep 3, 2024
1 parent d4b5553 commit 5a8ffea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/functional/p2p_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
from test_framework.test_node import ErrorMatch
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
append_config,
assert_equal,
p2p_port,
tor_port,
)
from test_framework.wallet import MiniWallet

Expand Down Expand Up @@ -57,6 +59,7 @@ def run_test(self):
# by modifying the configuration file.
ip_port = "127.0.0.1:{}".format(p2p_port(1))
self.nodes[1].replace_in_config([("bind=127.0.0.1", "whitebind=bloomfilter,forcerelay@" + ip_port)])
append_config(self.nodes[1].datadir_path, [f"bind=127.0.0.1:{tor_port(self.nodes[1].index)}=onion"])
self.checkpermission(
["[email protected]"],
# Check parameter interaction forcerelay should activate relay
Expand Down

0 comments on commit 5a8ffea

Please sign in to comment.