Commit bb7c786b authored by HackyMiner's avatar HackyMiner Committed by Felix Lange

trie: add missing unlock call in error case (#18985)

parent 98e0bedc
...@@ -679,6 +679,7 @@ func (db *Database) Commit(node common.Hash, report bool) error { ...@@ -679,6 +679,7 @@ func (db *Database) Commit(node common.Hash, report bool) error {
} }
if batch.ValueSize() > ethdb.IdealBatchSize { if batch.ValueSize() > ethdb.IdealBatchSize {
if err := batch.Write(); err != nil { if err := batch.Write(); err != nil {
db.lock.RUnlock()
return err return err
} }
batch.Reset() batch.Reset()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment