commit 3e2e6c7e77a041fb0dd31b993945ef7da766ea9c
Author: juga0 <juga(a)riseup.net>
Date: Tue Feb 2 11:40:04 2021 +0000
fix: relaylist: rename exits_not_bad_allowing_port
see previous commit
---
sbws/core/scanner.py | 2 +-
sbws/lib/relaylist.py | 2 +-
tests/integration/lib/test_destination.py | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sbws/core/scanner.py b/sbws/core/scanner.py
index 20f1b83..2736059 100644
--- a/sbws/core/scanner.py
+++ b/sbws/core/scanner.py
@@ -209,7 +209,7 @@ def _pick_ideal_second_hop(relay, dest, rl, cont, is_exit):
destination **dest**, pick a second relay that is or is not an exit
according to **is_exit**.
'''
- candidates = rl.exits_not_bad_allowing_port(dest.port) if is_exit \
+ candidates = rl.exits_not_bad_allowing_port_all_ips(dest.port) if is_exit \
else rl.non_exits
if not len(candidates):
return None
diff --git a/sbws/lib/relaylist.py b/sbws/lib/relaylist.py
index 86e0d7b..863689e 100644
--- a/sbws/lib/relaylist.py
+++ b/sbws/lib/relaylist.py
@@ -453,7 +453,7 @@ class RelayList:
"""Number of times a new consensus was obtained."""
return len(self._recent_consensus)
- def exits_not_bad_allowing_port(self, port):
+ def exits_not_bad_allowing_port_all_ips(self, port):
return [r for r in self.exits
if r.is_exit_not_bad_allowing_port_all_ips(port)]
diff --git a/tests/integration/lib/test_destination.py b/tests/integration/lib/test_destination.py
index 98ed89f..19f6617 100644
--- a/tests/integration/lib/test_destination.py
+++ b/tests/integration/lib/test_destination.py
@@ -26,7 +26,7 @@ def test_connect_to_destination_over_circuit_success(persistent_launch_tor,
relay = [r for r in rl.relays
if r.nickname == 'relay1mbyteMAB'][0]
# Choose an exit, for this test it does not matter the bandwidth
- helper = rl.exits_not_bad_allowing_port(destination.port)[0]
+ helper = rl.exits_not_bad_allowing_port_all_ips(destination.port)[0]
circuit_path = [relay.fingerprint, helper.fingerprint]
# build a circuit
circuit_id, _ = cb.build_circuit(circuit_path)
@@ -46,7 +46,7 @@ def test_connect_to_destination_over_circuit_fail(persistent_launch_tor,
relay = [r for r in rl.relays
if r.nickname == 'relay1mbyteMAB'][0]
# Choose an exit, for this test it does not matter the bandwidth
- helper = rl.exits_not_bad_allowing_port(bad_destination.port)[0]
+ helper = rl.exits_not_bad_allowing_port_all_ips(bad_destination.port)[0]
circuit_path = [relay.fingerprint, helper.fingerprint]
# Build a circuit.
circuit_id, _ = cb.build_circuit(circuit_path)
@@ -75,7 +75,7 @@ def test_functional_destinations(conf, cb, rl, persistent_launch_tor):
relay = [r for r in rl.relays
if r.nickname == 'relay1mbyteMAB'][0]
# Choose an exit, for this test it does not matter the bandwidth
- helper = rl.exits_not_bad_allowing_port(bad_destination.port)[0]
+ helper = rl.exits_not_bad_allowing_port_all_ips(bad_destination.port)[0]
circuit_path = [relay.fingerprint, helper.fingerprint]
# Build a circuit.
circuit_id, _ = cb.build_circuit(circuit_path)