trie: remove the duplicate write for preimage #23001 (#1068)

This commit is contained in:
Daniel Liu 2025-07-28 16:50:39 +08:00 committed by GitHub
parent f552cebfcd
commit cf5766177a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -686,12 +686,6 @@ func (db *Database) Commit(node common.Hash, report bool) error {
// Move all of the accumulated preimages into a write batch
if db.preimages != nil {
rawdb.WritePreimages(batch, db.preimages)
if batch.ValueSize() > ethdb.IdealBatchSize {
if err := batch.Write(); err != nil {
return err
}
batch.Reset()
}
// Since we're going to replay trie Node writes into the clean Cache, flush out
// any batched pre-images before continuing.
if err := batch.Write(); err != nil {