Skip to content

cmd/geth/config.go

Type MOD
Upstream Lines 476
Changed +6 -4

makeFullNode returns the *eth.Ethereum backend (for PoW mining wiring); cfg.Name uses databaseIdentifier so the datadir stays compatible

diff --git a/cmd/geth/config.go b/cmd/geth/config.go
index c02e307bd..a702872e6 100644
--- a/cmd/geth/config.go
+++ b/cmd/geth/config.go
@@ -36,6 +36,7 @@ import (
    "github.com/ethereum/go-ethereum/cmd/utils"
    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/crypto"
+   "github.com/ethereum/go-ethereum/eth"
    "github.com/ethereum/go-ethereum/eth/catalyst"
    "github.com/ethereum/go-ethereum/eth/ethconfig"
    "github.com/ethereum/go-ethereum/eth/syncer"
@@ -131,7 +132,7 @@ func loadConfig(file string, cfg *gethConfig) error {
 func defaultNodeConfig() node.Config {
    git, _ := version.VCS()
    cfg := node.DefaultConfig
-   cfg.Name = clientIdentifier
+   cfg.Name = databaseIdentifier
    cfg.Version = version.WithCommit(git.Commit, git.Date)
    cfg.HTTPModules = append(cfg.HTTPModules, "eth")
    cfg.WSModules = append(cfg.WSModules, "eth")
@@ -222,7 +223,7 @@ func constructDevModeBanner(ctx *cli.Context, cfg gethConfig) string {
 }

 // makeFullNode loads geth configuration and creates the Ethereum backend.
-func makeFullNode(ctx *cli.Context) *node.Node {
+func makeFullNode(ctx *cli.Context) (*node.Node, *eth.Ethereum) {
    stack, cfg := makeConfigNode(ctx)
    if ctx.IsSet(utils.OverrideOsaka.Name) {
        v := ctx.Uint64(utils.OverrideOsaka.Name)
@@ -311,14 +312,15 @@ func makeFullNode(ctx *cli.Context) *node.Node {
        blsyncer := blsync.NewClient(utils.MakeBeaconLightConfig(ctx))
        blsyncer.SetEngineRPC(rpc.DialInProc(srv))
        stack.RegisterLifecycle(blsyncer)
-   } else {
+   } else if !eth.BlockChain().Config().IsPow() {
        // Launch the engine API for interacting with external consensus client.
+       // Skip for PoW chains (ETC) which don't use beacon/consensus layer.
        err := catalyst.Register(stack, eth)
        if err != nil {
            utils.Fatalf("failed to register catalyst service: %v", err)
        }
    }
-   return stack
+   return stack, eth
 }

 // dumpConfig is the dumpconfig command.

← Back to CLI, Config & Genesis