diff options
author | Linus Nordberg <linus@nordberg.se> | 2021-06-16 13:18:53 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2021-06-16 13:18:53 +0200 |
commit | e79f6189d090fc0515c3e5935695787c51039c77 (patch) | |
tree | 34674e254c3d5c7994c615da5fadeb88d62dad6a | |
parent | 9f604cc3a7e77851cbb989145d500ec5b01f67a6 (diff) |
don't fetch consistency proof when tree hasn't grown
-rwxr-xr-x | siglog-witness.py | 8 |
1 files changed, 7 insertions, 1 deletions
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 |