geth 1.10.21 update with changes for API update in issue 177

This commit is contained in:
Michael Shaw
2022-08-01 13:27:29 -04:00
parent ba01123f54
commit 415e426946
7 changed files with 92 additions and 67 deletions
+5 -5
View File
@@ -190,21 +190,21 @@ func (pea *PublicEthAPI) GetBlockByHash(ctx context.Context, hash common.Hash, f
}
// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (pea *PublicEthAPI) ChainId() (*hexutil.Big, error) {
func (pea *PublicEthAPI) ChainId() *hexutil.Big {
block, err := pea.B.CurrentBlock()
if err != nil {
if pea.proxyOnError {
if id, err := pea.ethClient.ChainID(context.Background()); err == nil {
return (*hexutil.Big)(id), nil
return (*hexutil.Big)(id)
}
}
return nil, err
return nil
}
if config := pea.B.Config.ChainConfig; config.IsEIP155(block.Number()) {
return (*hexutil.Big)(config.ChainID), nil
return (*hexutil.Big)(config.ChainID)
}
return nil, fmt.Errorf("chain not synced beyond EIP-155 replay-protection fork block")
return nil
}
/*