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
@ -147,7 +147,7 @@ var bloomBitsPrefix = []byte("bloomBits-")
|
||||
|
||||
func clearBloomBits(db ethdb.Database) {
|
||||
fmt.Println("Clearing bloombits data...")
|
||||
it := db.NewIteratorWithPrefix(bloomBitsPrefix)
|
||||
it := db.NewIterator(bloomBitsPrefix, nil)
|
||||
for it.Next() {
|
||||
db.Delete(it.Key())
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ func testGetNodeData(t *testing.T, protocol int) {
|
||||
// Fetch for now the entire chain db
|
||||
hashes := []common.Hash{}
|
||||
|
||||
it := db.NewIterator()
|
||||
it := db.NewIterator(nil, nil)
|
||||
for it.Next() {
|
||||
if key := it.Key(); len(key) == common.HashLength {
|
||||
hashes = append(hashes, common.BytesToHash(key))
|
||||
|
Reference in New Issue
Block a user