From 5f0574bbc497efe9cddec370401009e63bc009d1 Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Thu, 12 Aug 2021 14:42:14 -0500 Subject: [PATCH] Run stack commands after plugin initialization --- cmd/geth/main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 581fc0352..a5c73418f 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -312,17 +312,16 @@ func prepare(ctx *cli.Context) { // blocking mode, waiting for it to be shut down. func geth(ctx *cli.Context) error { if err := plugins.Initialize(path.Join(ctx.GlobalString(utils.DataDirFlag.Name), "plugins"), ctx); err != nil { return err } + prepare(ctx) + stack, backend := makeFullNode(ctx) + pluginsInitializeNode(stack, backend) + defer stack.Close() if ok, err := plugins.RunSubcommand(ctx); ok { return err } if !plugins.ParseFlags(ctx.Args()) { if args := ctx.Args(); len(args) > 0 { return fmt.Errorf("invalid command: %q", args[0]) } } - - prepare(ctx) - stack, backend := makeFullNode(ctx) - pluginsInitializeNode(stack, backend) - defer stack.Close() stack.RegisterAPIs(pluginGetAPIs(stack, backend)) startNode(ctx, stack, backend)