Skip to content

Commit

Permalink
fix iavl/v2 reverse iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed Nov 29, 2024
1 parent 24d456d commit e6f1683
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion store/v2/commitment/iavlv2/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ func (t *Tree) Iterator(version uint64, start, end []byte, ascending bool) (core
if int64(version) != t.tree.Version() {
return nil, fmt.Errorf("loading past version not yet supported")
}
return t.tree.Iterator(start, end, ascending)
if ascending {
return t.tree.Iterator(start, end, false)
} else {
return t.tree.ReverseIterator(start, end)
}
}

func (t *Tree) Export(version uint64) (commitment.Exporter, error) {
Expand Down

0 comments on commit e6f1683

Please sign in to comment.