diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index c9ab72b6df..8cbef220ac 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -305,7 +305,8 @@ func exportChain(ctx *cli.Context) error { func copyDb(ctx *cli.Context) error { // Ensure we have a source chain directory to copy - if len(ctx.Args()) != 1 { + dbPath := ctx.Args().First() + if len(dbPath) == 0 { utils.Fatalf("Source chaindata directory path argument missing") } // Initialize a new chain for the running node to sync into @@ -316,7 +317,7 @@ func copyDb(ctx *cli.Context) error { dl := downloader.New(syncmode, chainDb, new(event.TypeMux), chain, nil, nil) // Create a source peer to satisfy downloader requests from - db, err := ethdb.NewLDBDatabase(ctx.Args().First(), ctx.GlobalInt(utils.CacheFlag.Name), 256) + db, err := ethdb.NewLDBDatabase(dbPath, ctx.GlobalInt(utils.CacheFlag.Name), 256) if err != nil { return err }