mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 14:48:46 +02:00
test: Improve loopback address check in rcp_bind.py
A loopback address can range from `127.0.0.0` to `127.255.255.255`. This commit relaxes the loopback check in `rpc_bind.py` by checking whether an IP address (from `all_interfaces()`) starts with `'127.'` instead of strictly matching `'127.0.0.1'`. Programs like VPNs might add an extra loopback address (e.g., 127.1.130.83), which failed under the previous state. These addresses will now pass with this update.
This commit is contained in:
@@ -109,7 +109,7 @@ class RPCBindTest(BitcoinTestFramework):
|
||||
raise AssertionError("all_interfaces() returned no IPv4 interfaces")
|
||||
self.non_loopback_ip = None
|
||||
for name,ip in interfaces:
|
||||
if ip != '127.0.0.1':
|
||||
if not ip.startswith('127.'):
|
||||
self.non_loopback_ip = ip
|
||||
break
|
||||
if self.non_loopback_ip is None and self.options.run_nonloopback:
|
||||
|
||||
Reference in New Issue
Block a user