Skip to content

Commit

Permalink
close db after dump
Browse files Browse the repository at this point in the history
  • Loading branch information
Eoous committed Sep 25, 2024
1 parent f3bc8ce commit d91799c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ func importPreimages(ctx *cli.Context) error {

func parseDumpConfig(ctx *cli.Context, stack *node.Node) (*state.DumpConfig, ethdb.Database, common.Hash, error) {
db := utils.MakeChainDatabase(ctx, stack, true)
defer db.Close()

var header *types.Header
if ctx.NArg() > 1 {
Expand Down Expand Up @@ -582,6 +581,7 @@ func dump(ctx *cli.Context) error {
if err != nil {
return err
}
defer db.Close()
triedb := utils.MakeTrieDatabase(ctx, stack, db, true, true, false) // always enable preimage lookup
defer triedb.Close()

Expand Down

0 comments on commit d91799c

Please sign in to comment.