[tor-commits] [sbws/master] fix: relalist: Use the consensus timestamp

juga at torproject.org juga at torproject.org
Tue Mar 16 14:19:10 UTC 2021


commit aa6b79d343dfe43fa6bb447a9d9c37d41c37e589
Author: juga0 <juga at riseup.net>
Date:   Fri Mar 5 11:51:59 2021 +0000

    fix: relalist: Use the consensus timestamp
    
    to the relay consensus timestamps list, so that it can be
    tested it was in a concrete consensus.
---
 sbws/lib/relaylist.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sbws/lib/relaylist.py b/sbws/lib/relaylist.py
index 4f33799..2a0bd8d 100644
--- a/sbws/lib/relaylist.py
+++ b/sbws/lib/relaylist.py
@@ -71,7 +71,11 @@ class Relay:
         self.relay_in_recent_consensus = timestamps.DateTimeSeq(
             [], MAX_RECENT_CONSENSUS_COUNT
         )
-        self.update_relay_in_recent_consensus()
+        # Use the same timestamp as the consensus, so that it can be tested
+        # that the relay was in a consensus using this timestamp.
+        # Note that this doesn't change the number of consensus the relay was
+        # in.
+        self.update_relay_in_recent_consensus(timestamp)
         # The number of times that a relay is "prioritized" to be measured.
         # It is incremented in ``RelayPrioritizer.best_priority``
         self.relay_recent_priority_list = timestamps.DateTimeSeq(





More information about the tor-commits mailing list