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:
committed by
GitHub
parent
00064ddcfb
commit
6402c42b67
@ -148,10 +148,10 @@ type diskAccountIterator struct {
|
||||
|
||||
// AccountIterator creates an account iterator over a disk layer.
|
||||
func (dl *diskLayer) AccountIterator(seek common.Hash) AccountIterator {
|
||||
// TODO: Fix seek position, or remove seek parameter
|
||||
pos := common.TrimRightZeroes(seek[:])
|
||||
return &diskAccountIterator{
|
||||
layer: dl,
|
||||
it: dl.diskdb.NewIteratorWithPrefix(rawdb.SnapshotAccountPrefix),
|
||||
it: dl.diskdb.NewIterator(rawdb.SnapshotAccountPrefix, pos),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user