Skip to content

Commit

Permalink
fix: panic on starting iterator with same start and end (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Woo authored Dec 15, 2021
1 parent 3a199c4 commit 98f46da
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions bin/v0.34.x/db/hld/height_limited_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ func (hld *HeightLimitedDB) DeleteSync(key []byte) error {
// CONTRACT: No writes may happen within a domain while an iterator exists over it.
// CONTRACT: start, end readonly []byte
func (hld *HeightLimitedDB) Iterator(start, end []byte) (tmdb.Iterator, error) {
if bytes.Compare(start, end) == 0 {
return nil, fmt.Errorf("invalid iterator operation; start_store_key=%v, end_store_key=%v", start, end)
}

return hld.odb.Iterator(hld.GetCurrentReadHeight(), start, end)
}

Expand All @@ -165,10 +161,6 @@ func (hld *HeightLimitedDB) Iterator(start, end []byte) (tmdb.Iterator, error) {
// CONTRACT: No writes may happen within a domain while an iterator exists over it.
// CONTRACT: start, end readonly []byte
func (hld *HeightLimitedDB) ReverseIterator(start, end []byte) (tmdb.Iterator, error) {
if bytes.Compare(start, end) == 0 {
return nil, fmt.Errorf("invalid iterator operation; start_store_key=%v, end_store_key=%v", start, end)
}

return hld.odb.ReverseIterator(hld.GetCurrentReadHeight(), start, end)
}

Expand Down

0 comments on commit 98f46da

Please sign in to comment.