Skip to content

Commit

Permalink
Skip consistency check when root is size zero
Browse files Browse the repository at this point in the history
Any head is consistent with empty root.
  • Loading branch information
hickford committed Jul 27, 2022
1 parent 17a86b3 commit c944b39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trillian/migrillian/core/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ func (c *Controller) fetchTail(ctx context.Context, begin uint64) (uint64, error
// verifyConsistency checks that the provided verified Trillian root is
// consistent with the CT log's STH.
func (c *Controller) verifyConsistency(ctx context.Context, treeSize uint64, rootHash []byte, sth *ct.SignedTreeHead) error {
if treeSize == 0 {
// Any head is consistent with empty root -- unnecessary to request empty proof.
return nil
}
if c.opts.NoConsistencyCheck {
glog.Warningf("%s: skipping consistency check", c.label)
return nil
Expand Down

0 comments on commit c944b39

Please sign in to comment.