[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/maint-1.1] chg: v3bwfile: Exclude relays without observed bw



commit a44ffcb20d0efcd68b3a80b080494f3c7a5da1e2
Author: juga0 <juga@xxxxxxxxxx>
Date:   Sun May 17 13:30:03 2020 +0000

    chg: v3bwfile: Exclude relays without observed bw
    
    and without consensus bw from scaling.
    
    Part of #33871, closes #33831.
---
 sbws/lib/v3bwfile.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index 263a285..56925cb 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -773,6 +773,13 @@ class V3BWLine(object):
         desc_bw_obs_last = \
             cls.desc_bw_obs_last_from_results(results_recent)
 
+        # Exclude also relays without consensus bandwidth nor observed
+        # bandwidth, since they can't be scaled
+        if (desc_bw_obs_last is None and consensus_bandwidth is None):
+            # This reason is not counted, not added in the file, but it will
+            # have vote = 0
+            return(cls(node_id, 1), "no_consensus_no_observed_bw")
+
         # For any line not excluded, do not include vote and unmeasured
         # KeyValues
         del kwargs['vote']



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits