From 5f750498f4cc26389b6b6f0a6b825538a6f49d71 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 18 Feb 2025 21:06:37 +0800 Subject: [PATCH] les: copy constans after get networkID --- les/backend.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/les/backend.go b/les/backend.go index 0f250f5181..3b0f6bed41 100644 --- a/les/backend.go +++ b/les/backend.go @@ -92,6 +92,12 @@ func New(ctx *node.ServiceContext, config *ethconfig.Config) (*LightEthereum, er return nil, genesisErr } + networkID := config.NetworkId + if networkID == 0 { + networkID = chainConfig.ChainId.Uint64() + } + common.CopyConstans(networkID) + log.Info(strings.Repeat("-", 153)) for _, line := range strings.Split(chainConfig.Description(), "\n") { log.Info(line) @@ -101,10 +107,6 @@ func New(ctx *node.ServiceContext, config *ethconfig.Config) (*LightEthereum, er peers := newPeerSet() quitSync := make(chan struct{}) - networkID := config.NetworkId - if networkID == 0 { - networkID = chainConfig.ChainId.Uint64() - } leth := &LightEthereum{ config: config, chainConfig: chainConfig,