Skip to content

Commit

Permalink
docs: add comment to leaf case in verify subtree roots inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Aug 2, 2024
1 parent 568f0e2 commit 95eed76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ func (proof Proof) VerifySubtreeRootInclusion(nth *NmtHasher, subtreeRoots [][]b
return popIfNonEmpty(&subtreeRoots), nil
}

// at this level, we reached a leaf, but we couldn't find any range corresponding
// to needed leaf [start, end).
// this means that the initial provided [start, end) range was invalid.
if end-start == 1 {
return nil, fmt.Errorf("the provided range [%d, %d) does not reference a valid inner node", proof.start, proof.end)
}
Expand Down

0 comments on commit 95eed76

Please sign in to comment.