[tor-commits] [sbws/master] scanner: use consensus_bandwidth when sorting relays

juga at torproject.org juga at torproject.org
Fri Jan 11 14:26:18 UTC 2019


commit ca463e5e3432b13fb6f3c781fb8d96a9b45ee7be
Author: juga0 <juga at riseup.net>
Date:   Wed Dec 19 18:10:49 2018 +0000

    scanner: use consensus_bandwidth when sorting relays
    
    instead of bandwidth.
    Forgotten when bandwidth was renamed to consensus_bandwidth in
    9e089b72d8abfb2b2a6c2ec9a66cb01d115205a6.
---
 sbws/core/scanner.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sbws/core/scanner.py b/sbws/core/scanner.py
index 80251ec..39dddba 100644
--- a/sbws/core/scanner.py
+++ b/sbws/core/scanner.py
@@ -154,7 +154,8 @@ def _pick_ideal_second_hop(relay, dest, rl, cont, is_exit):
                 len(new_candidates), min_bw_factor, relay.nickname,
                 chosen.nickname, chosen.consensus_bandwidth)
             return chosen
-    candidates = sorted(candidates, key=lambda r: r.bandwidth, reverse=True)
+    candidates = sorted(candidates, key=lambda r: r.consensus_bandwidth,
+                        reverse=True)
     chosen = candidates[0]
     log.debug(
         'Didn\'t find any 2nd hops at least as fast as %s (bw=%s). It\'s '





More information about the tor-commits mailing list