summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2018-12-07 15:53:13 +1000
committerteor <teor@torproject.org>2018-12-07 15:54:32 +1000
commit7f3a7d9a2713ecddaf0cd8e08e054de4c2870792 (patch)
treed7f6395d00742f0c3c34ed0b55729889ae6b7eb7 /scripts
parentc3fe405e217d1551b3a58f2469f05650dd9d7579 (diff)
downloadtor-7f3a7d9a2713ecddaf0cd8e08e054de4c2870792.tar.gz
tor-7f3a7d9a2713ecddaf0cd8e08e054de4c2870792.zip
Fallbacks: Rename CONSENSUS_EXPIRY_TOLERANCE to REASONABLY_LIVE_TIME
Cleanup after 28768.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/updateFallbackDirs.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
index 142d468273..914d121345 100755
--- a/scripts/maint/updateFallbackDirs.py
+++ b/scripts/maint/updateFallbackDirs.py
@@ -115,12 +115,12 @@ DOWNLOAD_MICRODESC_CONSENSUS = True
# so that 0.2.9 relays also fail the download check if they serve a consensus
# that is not reasonably live.
#
-# CONSENSUS_EXPIRY_TOLERANCE should never be more than 24 hours, because
-# clients reject consensuses that are older than REASONABLY_LIVE_TIME. Clients
-# on 0.3.5.5-alpha? and earlier also won't select guards from consensuses that
-# have expired, but can bootstrap if they already have guards in their state
-# file.
-CONSENSUS_EXPIRY_TOLERANCE = 24*60*60
+# REASONABLY_LIVE_TIME should never be more than Tor's REASONABLY_LIVE_TIME,
+# (24 hours), because clients reject consensuses that are older than that.
+# Clients on 0.3.5.5-alpha? and earlier also won't select guards from
+# consensuses that have expired, but can bootstrap if they already have guards
+# in their state file.
+REASONABLY_LIVE_TIME = 24*60*60
# Output fallback name, flags, bandwidth, and ContactInfo in a C comment?
OUTPUT_COMMENTS = True if OUTPUT_CANDIDATES else False
@@ -1150,8 +1150,8 @@ class Candidate(object):
download_failed = True
elif (time_since_expiry > 0):
status = 'outdated consensus, expired %ds ago'%(int(time_since_expiry))
- if time_since_expiry <= CONSENSUS_EXPIRY_TOLERANCE:
- status += ', tolerating up to %ds'%(CONSENSUS_EXPIRY_TOLERANCE)
+ if time_since_expiry <= REASONABLY_LIVE_TIME:
+ status += ', tolerating up to %ds'%(REASONABLY_LIVE_TIME)
level = logging.INFO
else:
status += ', invalid'
@@ -1159,8 +1159,8 @@ class Candidate(object):
download_failed = True
elif (time_until_valid > 0):
status = 'future consensus, valid in %ds'%(int(time_until_valid))
- if time_until_valid <= CONSENSUS_EXPIRY_TOLERANCE:
- status += ', tolerating up to %ds'%(CONSENSUS_EXPIRY_TOLERANCE)
+ if time_until_valid <= REASONABLY_LIVE_TIME:
+ status += ', tolerating up to %ds'%(REASONABLY_LIVE_TIME)
level = logging.INFO
else:
status += ', invalid'