From b971f9fd66125d83b11174498cfb25be1673db16 Mon Sep 17 00:00:00 2001 From: "lightclient@protonmail.com" Date: Fri, 24 Jun 2022 17:19:08 +0200 Subject: [PATCH] internal/ethapi: always return chain id --- internal/ethapi/api.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 7f12fdb95232..c4bf86a40bd2 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -609,12 +609,8 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI { } // ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config. -func (api *BlockChainAPI) ChainId() (*hexutil.Big, error) { - // if current block is at or past the EIP-155 replay-protection fork block, return chainID from config - if config := api.b.ChainConfig(); config.IsEIP155(api.b.CurrentBlock().Number()) { - return (*hexutil.Big)(config.ChainID), nil - } - return nil, fmt.Errorf("chain not synced beyond EIP-155 replay-protection fork block") +func (api *BlockChainAPI) ChainId() *hexutil.Big { + return (*hexutil.Big)(api.b.ChainConfig().ChainID) } // BlockNumber returns the block number of the chain head.