From ad3d8cb12a368ea901a2b36b0708480065235308 Mon Sep 17 00:00:00 2001 From: xiaodong <81516175+javaandfly@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:13:03 +0800 Subject: [PATCH] cmd/geth: remove unused parameter (#29602) --- cmd/geth/config.go | 5 ++--- cmd/geth/consolecmd.go | 4 ++-- cmd/geth/main.go | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 3f3ed510f3..522e5e22f2 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -37,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/eth/catalyst" "github.com/ethereum/go-ethereum/eth/ethconfig" - "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/internal/flags" "github.com/ethereum/go-ethereum/internal/version" "github.com/ethereum/go-ethereum/log" @@ -169,7 +168,7 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) { } // makeFullNode loads geth configuration and creates the Ethereum backend. -func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { +func makeFullNode(ctx *cli.Context) *node.Node { stack, cfg := makeConfigNode(ctx) if ctx.IsSet(utils.OverrideCancun.Name) { v := ctx.Uint64(utils.OverrideCancun.Name) @@ -238,7 +237,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { utils.Fatalf("failed to register catalyst service: %v", err) } } - return stack, backend + return stack } // dumpConfig is the dumpconfig command. diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 526ede9619..e2d3125559 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -70,8 +70,8 @@ JavaScript API. See https://geth.ethereum.org/docs/interacting-with-geth/javascr func localConsole(ctx *cli.Context) error { // Create and start the node based on the CLI flags prepare(ctx) - stack, backend := makeFullNode(ctx) - startNode(ctx, stack, backend, true) + stack := makeFullNode(ctx) + startNode(ctx, stack, true) defer stack.Close() // Attach to the newly started node and create the JavaScript console. diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 8ec70aedf9..37b99a2621 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -33,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/internal/flags" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" @@ -348,10 +347,10 @@ func geth(ctx *cli.Context) error { } prepare(ctx) - stack, backend := makeFullNode(ctx) + stack := makeFullNode(ctx) defer stack.Close() - startNode(ctx, stack, backend, false) + startNode(ctx, stack, false) stack.Wait() return nil } @@ -359,7 +358,7 @@ func geth(ctx *cli.Context) error { // startNode boots up the system node and all registered protocols, after which // it unlocks any requested accounts, and starts the RPC/IPC interfaces and the // miner. -func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isConsole bool) { +func startNode(ctx *cli.Context, stack *node.Node, isConsole bool) { debug.Memsize.Add("node", stack) // Start up the node itself