Przeglądaj źródła

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

HackyMiner 6 lat temu
rodzic
commit
bb7c786b09
1 zmienionych plików z 1 dodań i 0 usunięć
  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()