From d91799ce4861953fbc8f8e7482a212307fb18cd6 Mon Sep 17 00:00:00 2001 From: Eoous <38656355+Eoous@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:57:27 +0800 Subject: [PATCH] close db after dump --- cmd/geth/chaincmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 7421b21622..3aee199fc4 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -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 { @@ -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()