Patch for concurrent iterator & others (onto v1.11.6) #386

Closed
roysc wants to merge 1565 commits from v1.11.6-statediff-v5 into master
Showing only changes of commit 647c6f2db6 - Show all commits

View File

@ -609,12 +609,8 @@ func NewBlockChainAPI(b Backend) *BlockChainAPI {
} }
// ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config. // ChainId is the EIP-155 replay-protection chain id for the current Ethereum chain config.
func (api *BlockChainAPI) ChainId() (*hexutil.Big, error) { func (api *BlockChainAPI) ChainId() *hexutil.Big {
// if current block is at or past the EIP-155 replay-protection fork block, return chainID from config return (*hexutil.Big)(api.b.ChainConfig().ChainID)
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")
} }
// BlockNumber returns the block number of the chain head. // BlockNumber returns the block number of the chain head.