Commit 305e75d4 authored by Matt Traudt's avatar Matt Traudt
Browse files

Measure Exit+BadExit relays as non-exits

parent c21c6e9e
......@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Fixed
- Measure relays that have both Exit and BadExit as non-exits, which is how
clients would use them. (GH#217)
## [0.5.0] - 2018-06-26
......
......@@ -178,7 +178,8 @@ def measure_relay(args, conf, destinations, cb, rl, relay):
# exit, then pick a non-exit. Otherwise pick an exit.
helper = None
circ_fps = None
if relay.can_exit_to(dest.hostname, dest.port):
if relay.can_exit_to(dest.hostname, dest.port) and \
relay not in rl.bad_exits:
helper = _pick_ideal_second_hop(
relay, dest, rl, cb.controller, is_exit=False)
if helper:
......
......@@ -163,6 +163,10 @@ class RelayList:
def exits(self):
return self._relays_with_flag(Flag.EXIT)
@property
def bad_exits(self):
return self._relays_without_flag(Flag.BADEXIT)
@property
def non_exits(self):
return self._relays_without_flag(Flag.EXIT)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment