add flag to halt after chain importing

This commit is contained in:
whyrusleeping 2020-01-20 17:58:58 -08:00
parent 955b755055
commit d9f5f6e2c6

View File

@ -66,6 +66,10 @@ var DaemonCmd = &cli.Command{
Name: "import-chain",
Usage: "on first run, load chain from given file",
},
&cli.BoolFlag{
Name: "halt-after-import",
Usage: "halt the process after importing chain from file",
},
},
Action: func(cctx *cli.Context) error {
ctx := context.Background()
@ -96,6 +100,9 @@ var DaemonCmd = &cli.Command{
if err := ImportChain(r, chainfile); err != nil {
return err
}
if cctx.Bool("halt-after-import") {
return nil
}
}
genesis := node.Options()