all: simplify and fix database iteration with prefix/start (#20808)

* core/state/snapshot: start fixing disk iterator seek

* ethdb, rawdb, leveldb, memorydb: implement iterators with prefix and start

* les, core/state/snapshot: iterator fixes

* all: remove two iterator methods

* all: rename Iteratee.NewIteratorWith -> NewIterator

* ethdb: fix review concerns
This commit is contained in:
Martin Holst Swende
2020-04-15 13:08:53 +02:00
committed by GitHub
parent 00064ddcfb
commit 6402c42b67
24 changed files with 248 additions and 187 deletions

View File

@ -301,7 +301,7 @@ func ExportPreimages(db ethdb.Database, fn string) error {
defer writer.(*gzip.Writer).Close()
}
// Iterate over the preimages and export them
it := db.NewIteratorWithPrefix([]byte("secure-key-"))
it := db.NewIterator([]byte("secure-key-"), nil)
defer it.Release()
for it.Next() {