Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #109 from TheTorProject/aggregate_fixes
Browse files Browse the repository at this point in the history
Aggregate fixes
  • Loading branch information
juga0 authored Mar 25, 2018
2 parents 5ccbdfc + f6e2931 commit daf23e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bwscanner/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json

from twisted.internet.defer import inlineCallbacks
from txtorcon.torcontrolprotocol import TorProtocolError
from stem.descriptor.server_descriptor import RelayDescriptor
from stem.descriptor.router_status_entry import RouterStatusEntryV3

Expand Down Expand Up @@ -65,8 +66,13 @@ def write_aggregate_data(tor, scan_dirs, file_name="aggregate_measurements"):
log.debug("Could not calculate a valid filtered bandwidth, skipping relay.")
continue

routerstatus_info = yield tor.protocol.get_info_raw('ns/id/' + relay_fp.lstrip("$"))
descriptor_info = yield tor.protocol.get_info_raw('desc/id/' + relay_fp.lstrip("$"))
try:
routerstatus_info = yield tor.protocol.get_info_raw('ns/id/' + relay_fp.lstrip("$"))
descriptor_info = yield tor.protocol.get_info_raw('desc/id/' + relay_fp.lstrip("$"))
except TorProtocolError:
log.info("Relay {fp} not found in consensus!", fp=relay_fp)
continue

relay_routerstatus = RouterStatusEntryV3(routerstatus_info)
relay_descriptor = RelayDescriptor(descriptor_info)

Expand Down

0 comments on commit daf23e6

Please sign in to comment.