Sfoglia il codice sorgente

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

HackyMiner 6 anni fa
parent
commit
bb7c786b09
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      trie/database.go

+ 1 - 0
trie/database.go

@@ -679,6 +679,7 @@ func (db *Database) Commit(node common.Hash, report bool) error {
 		}
 		if batch.ValueSize() > ethdb.IdealBatchSize {
 			if err := batch.Write(); err != nil {
+				db.lock.RUnlock()
 				return err
 			}
 			batch.Reset()