[tor-commits] [bridgedb/master] Update bridgehistory timestamps for each bridge, as appropriate.
isis at torproject.org
isis at torproject.org
Sun Mar 16 19:04:57 UTC 2014
commit ff3a2641ac3447238511ce3436386d9ee2553011
Author: Matthew Finkel <Matthew.Finkel at gmail.com>
Date: Tue Mar 4 04:03:29 2014 +0000
Update bridgehistory timestamps for each bridge, as appropriate.
---
lib/bridgedb/Main.py | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index 36e4e88..28d6c8f 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -124,16 +124,17 @@ def load(state, splitter, clear=False):
logging.info("Opening bridge-server-descriptor file: '%s'" % fname)
f = open(fname, 'r')
desc_digests.update(Bridges.getDescriptorDigests(f))
- if bridge.getID() in timestamps.keys():
- ts = timestamps[bridge.getID()][:]
- ts.sort()
- for timestamp in ts:
- logging.debug(
- "Adding/updating timestamps in BridgeHistory for "\
- "'%s' in database: %s"
- % (bridge.fingerprint, timestamp))
- bridgedb.Stability.addOrUpdateBridgeHistory(
- bridge, timestamp)
+ for bridge in bridges.values():
+ if bridge.getID() in timestamps.keys():
+ ts = timestamps[bridge.getID()][:]
+ ts.sort()
+ for timestamp in ts:
+ logging.debug(
+ "Adding/updating timestamps in BridgeHistory for "\
+ "'%s' in database: %s"
+ % (bridge.fingerprint, timestamp))
+ bridgedb.Stability.addOrUpdateBridgeHistory(
+ bridge, timestamp)
logging.debug("Closing bridge-server-descriptor file: '%s'" % fname)
f.close()
More information about the tor-commits
mailing list