mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 10:42:23 +02:00
net: respect -onlynet= when making outbound connections
Do not make outbound connections to hosts which belong to a network which is restricted by `-onlynet`. This applies to hosts that are automatically chosen to connect to and to anchors. This does not apply to hosts given to `-connect`, `-addnode`, `addnode` RPC, dns seeds, `-seednodes`. Fixes https://github.com/bitcoin/bitcoin/issues/13378 Fixes https://github.com/bitcoin/bitcoin/issues/22647 Supersedes https://github.com/bitcoin/bitcoin/pull/22651
This commit is contained in:
@ -280,7 +280,7 @@ class ProxyTest(BitcoinTestFramework):
|
||||
n3 = networks_dict(self.nodes[3].getnetworkinfo())
|
||||
assert_equal(NETWORKS, n3.keys())
|
||||
for net in NETWORKS:
|
||||
if net == NET_I2P:
|
||||
if net == NET_I2P or net == NET_ONION:
|
||||
expected_proxy = ''
|
||||
else:
|
||||
expected_proxy = f'[{self.conf3.addr[0]}]:{self.conf3.addr[1]}'
|
||||
|
Reference in New Issue
Block a user