commit b08694693777e4ba850589c5cf7c898e94ffe7b5 Author: Matt Traudt sirmatt@ksu.edu Date: Fri Jun 22 09:55:21 2018 -0400
Make sure we are appropriately blocking when using our list of relays
I'm not sure if this is necessary, honestly. But it doesn't hurt. --- sbws/lib/relaylist.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sbws/lib/relaylist.py b/sbws/lib/relaylist.py index 8b19a7c..6245aa1 100644 --- a/sbws/lib/relaylist.py +++ b/sbws/lib/relaylist.py @@ -168,16 +168,13 @@ class RelayList: return self._relays_with_flag(Flag.AUTHORITY)
def random_relay(self): - relays = self.relays - return self.rng.choice(relays) + return self.rng.choice(self.relays)
def _relays_with_flag(self, flag): - relays = self.relays - return [r for r in relays if flag in r.flags] + return [r for r in self.relays if flag in r.flags]
def _relays_without_flag(self, flag): - relays = self.relays - return [r for r in relays if flag not in r.flags] + return [r for r in self.relays if flag not in r.flags]
def _init_relays(self): c = self._controller
tor-commits@lists.torproject.org