mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 01:40:44 +00:00
Co-authored-by: Amir Hossein <77993374+Kamandlou@users.noreply.github.com>
This commit is contained in:
parent
4bb925258d
commit
d11e128322
1 changed files with 7 additions and 3 deletions
|
|
@ -677,8 +677,9 @@ func (db *Database) Commit(node common.Hash, report bool) error {
|
||||||
// Uncache any leftovers in the last batch
|
// Uncache any leftovers in the last batch
|
||||||
db.lock.Lock()
|
db.lock.Lock()
|
||||||
defer db.lock.Unlock()
|
defer db.lock.Unlock()
|
||||||
|
if err := batch.Replay(uncacher); err != nil {
|
||||||
batch.Replay(uncacher)
|
return err
|
||||||
|
}
|
||||||
batch.Reset()
|
batch.Reset()
|
||||||
|
|
||||||
// Reset the storage counters and bumped metrics
|
// Reset the storage counters and bumped metrics
|
||||||
|
|
@ -723,9 +724,12 @@ func (db *Database) commit(hash common.Hash, batch ethdb.Batch, uncacher *cleane
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
db.lock.Lock()
|
db.lock.Lock()
|
||||||
batch.Replay(uncacher)
|
err := batch.Replay(uncacher)
|
||||||
batch.Reset()
|
batch.Reset()
|
||||||
db.lock.Unlock()
|
db.lock.Unlock()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue