[stem/master] Adding constraints for new consensus parameters

commit 3b0f736c899e741721f3c9667d98a34f1cc04c5c Author: Damian Johnson <atagar@torproject.org> Date: Sat Nov 15 12:22:05 2014 -0800 Adding constraints for new consensus parameters Checking the constraints of new tor consensus parameters... https://gitweb.torproject.org/torspec.git/commitdiff/2ad7829 --- stem/descriptor/networkstatus.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stem/descriptor/networkstatus.py b/stem/descriptor/networkstatus.py index c861236..1e516d3 100644 --- a/stem/descriptor/networkstatus.py +++ b/stem/descriptor/networkstatus.py @@ -836,6 +836,20 @@ class _DocumentHeader(object): minimum, maximum = 0, 1 elif key == 'usecreatefast': minimum, maximum = 0, 1 + elif key == 'UseNTorHandshake': + minimum, maximum = 0, 1 + elif key == 'FastFlagMinThreshold': + minimum = 4 + elif key == 'NumDirectoryGuards': + minimum, maximum = 0, 10 + elif key == 'NumEntryGuards': + minimum, maximum = 1, 10 + elif key == 'GuardLifetime': + minimum, maximum = 2592000, 157766400 # min: 30 days, max: 1826 days + elif key == 'NumNTorsPerTAP': + minimum, maximum = 1, 100000 + elif key == 'AllowNonearlyExtend': + minimum, maximum = 0, 1 if value < minimum or value > maximum: raise ValueError("'%s' value on the params line must be in the range of %i - %i, was %i" % (key, minimum, maximum, value))
participants (1)
-
atagar@torproject.org