Skip to content

Commit 18b4ee5

Browse files
authored
ethdb/leveldb: check iterator error in Database.DeleteRange (#32384)
Add missing it.Error() check after iteration in Database.DeleteRange to avoid silently ignoring iterator errors before writing the batch. Aligns behavior with batch.DeleteRange, which already validates iterator errors. No other functional changes; existing tests pass (TestLevelDB).
1 parent 8ba1c79 commit 18b4ee5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ethdb/leveldb/leveldb.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ func (db *Database) DeleteRange(start, end []byte) error {
233233
return err
234234
}
235235
}
236+
if err := it.Error(); err != nil {
237+
return err
238+
}
236239
return batch.Write()
237240
}
238241

0 commit comments

Comments
 (0)