core/state/snapshot, ethdb: track deletions more accurately (#22582)

* core/state/snapshot, ethdb: track deletions more accurately

* core/state/snapshot: don't reset the iterator, leveldb's screwy

* ethdb: don't mess with the insert batches for now
This commit is contained in:
Péter Szilágyi
2021-03-30 19:04:22 +03:00
committed by GitHub
parent 3faae5defc
commit 61ff3e86b2
3 changed files with 22 additions and 3 deletions

View File

@ -211,7 +211,7 @@ func (b *batch) Put(key, value []byte) error {
// Delete inserts the a key removal into the batch for later committing.
func (b *batch) Delete(key []byte) error {
b.writes = append(b.writes, keyvalue{common.CopyBytes(key), nil, true})
b.size += 1
b.size += len(key)
return nil
}