Skip to content

Commit

Permalink
Merge branch 'master' into test-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
anodar authored Jul 12, 2023
2 parents 73f3376 + 4f54e6b commit 2890c86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arbnode/dataposter/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func idxToKey(idx uint64) []byte {
func (s *Storage[Item]) GetContents(_ context.Context, startingIndex uint64, maxResults uint64) ([]*Item, error) {
var res []*Item
it := s.db.NewIterator([]byte(""), idxToKey(startingIndex))
defer it.Release()
for i := 0; i < int(maxResults); i++ {
if !it.Next() {
break
Expand Down Expand Up @@ -91,6 +92,7 @@ func (s *Storage[Item]) Prune(ctx context.Context, keepStartingAt uint64) error
}
end := idxToKey(keepStartingAt)
it := s.db.NewIterator([]byte{}, idxToKey(0))
defer it.Release()
b := s.db.NewBatch()
for it.Next() {
if bytes.Compare(it.Key(), end) >= 0 {
Expand Down

0 comments on commit 2890c86

Please sign in to comment.