forked from cerc-io/plugeth
cmd/geth: Fix chain purging from cmd line
This commit is contained in:
parent
e1da124415
commit
4d5501c46a
@ -115,17 +115,16 @@ func exportChain(ctx *cli.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func removeDB(ctx *cli.Context) {
|
func removeDB(ctx *cli.Context) {
|
||||||
confirm, err := utils.PromptConfirm("Remove local databases?")
|
confirm, err := utils.PromptConfirm("Remove local database?")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.Fatalf("%v", err)
|
utils.Fatalf("%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if confirm {
|
if confirm {
|
||||||
fmt.Println("Removing chain and state databases...")
|
fmt.Println("Removing chaindata...")
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "blockchain"))
|
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "chaindata"))
|
||||||
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "state"))
|
|
||||||
|
|
||||||
fmt.Printf("Removed in %v\n", time.Since(start))
|
fmt.Printf("Removed in %v\n", time.Since(start))
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user