diff --git a/store/v2/commitment/iavlv2/tree.go b/store/v2/commitment/iavlv2/tree.go index 14b7967a6c78..43c25a23a2c8 100644 --- a/store/v2/commitment/iavlv2/tree.go +++ b/store/v2/commitment/iavlv2/tree.go @@ -113,7 +113,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) {