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

This commit is contained in:
HackyMiner 2019-02-04 20:42:46 +09:00 committed by Felix Lange
parent 98e0bedcd7
commit bb7c786b09

View File

@ -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()