From e79f6189d090fc0515c3e5935695787c51039c77 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 16 Jun 2021 13:18:53 +0200 Subject: don't fetch consistency proof when tree hasn't grown --- siglog-witness.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/siglog-witness.py b/siglog-witness.py index 3b79c8d..0ddb8b7 100755 --- a/siglog-witness.py +++ b/siglog-witness.py @@ -203,7 +203,13 @@ class TreeHead: self.root_hash, prev.root_hash)) - # Same hash and size but new timestamp is ok. + # New timestamp but same hash and size is ok but there's no + # consistency to prove. + if self.root_hash == prev.root_hash: + assert(self.tree_size == prev.tree_size) + assert(self.timestamp != prev.timestamp) + print("INFO: Signing re-published head of tree of size {}".format(self.tree_size)) + return None # Success proof, err = fetch_consistency_proof(prev.tree_size, self.tree_size) if err: return err -- cgit v1.2.3