Skip to content

Commit

Permalink
Merge pull request #339 from kcalvinalvin/forest-provebatch-bugfix
Browse files Browse the repository at this point in the history
accumulator/forestproofs: Fix bug in ProveBatch()
  • Loading branch information
adiabat authored Feb 14, 2022
2 parents 3f771bb + 56d86eb commit df7b3aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion accumulator/forestproofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ func (f *Forest) ProveBatch(hs []Hash) (BatchProof, error) {
if len(hs) == 0 {
return bp, nil
}
if f.data.size() < 2 {
// When there is only 1 leaf in the entire forest, the leaf is the proof.
// When there are no leaves, there's nothing to prove.
if f.numLeaves <= 1 {
return bp, nil
}

Expand Down

0 comments on commit df7b3aa

Please sign in to comment.