Commit ab413321 authored by juga's avatar juga
Browse files

fix: v3bwfile: Add method to set under_min_report KeyValue

in the Bandwidth Lines.
When the minimum percent of relays it's not reached, still report
the relays but set KeyValues accordingly so that Tor doesn't vote
on their bandwidth.

Part of #29853.
parent 702ceedc
......@@ -977,6 +977,17 @@ class V3BWFile(object):
key=lambda l:
return cls(header, bw_lines)
def set_under_min_report(bw_lines):
Mondify the Bandwidth Lines adding the KeyValue `under_min_report`,
log.debug("Setting `under_min_report` to %s lines.", len(bw_lines))
for l in bw_lines:
l.under_min_report = 1 = 0
def bw_kb(bw_lines, reverse=False):
bw_lines_scaled = copy.deepcopy(bw_lines)
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