mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
eth: close last iterator on successful db upgrage
This commit is contained in:
parent
655a1802fa
commit
7f33092187
1 changed files with 6 additions and 1 deletions
|
|
@ -53,7 +53,9 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
|
|||
// Create an iterator to read the entire database and covert old lookup entires
|
||||
it := db.(*ethdb.LDBDatabase).NewIterator()
|
||||
defer func() {
|
||||
it.Release()
|
||||
if it != nil {
|
||||
it.Release()
|
||||
}
|
||||
}()
|
||||
|
||||
var (
|
||||
|
|
@ -119,6 +121,9 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
|
|||
} else {
|
||||
log.Error("Database deduplication failed", "deduped", converted, "err", failed)
|
||||
}
|
||||
it.Release()
|
||||
it = nil
|
||||
|
||||
errc := <-stop
|
||||
errc <- failed
|
||||
}()
|
||||
|
|
|
|||
Loading…
Reference in a new issue