File tree 2 files changed +7
-12
lines changed
2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,6 @@ func (api *PublicEthereumAPI) Coinbase() (common.Address, error) {
61
61
return api .Etherbase ()
62
62
}
63
63
64
- // ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
65
- func (api * PublicEthereumAPI ) ChainId () (hexutil.Uint64 , error ) {
66
- // if current block is at or past the EIP-155 replay-protection fork block, return chainID from config
67
- if config := api .e .blockchain .Config (); config .IsEIP155 (api .e .blockchain .CurrentBlock ().Number ()) {
68
- return (hexutil .Uint64 )(config .ChainID .Uint64 ()), nil
69
- }
70
- return hexutil .Uint64 (0 ), fmt .Errorf ("chain not synced beyond EIP-155 replay-protection fork block" )
71
- }
72
-
73
64
// PublicMinerAPI provides an API to control the miner.
74
65
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
75
66
type PublicMinerAPI struct {
Original file line number Diff line number Diff line change @@ -529,9 +529,13 @@ func NewPublicBlockChainAPI(b Backend) *PublicBlockChainAPI {
529
529
return & PublicBlockChainAPI {b }
530
530
}
531
531
532
- // ChainId returns the chainID value for transaction replay protection.
533
- func (s * PublicBlockChainAPI ) ChainId () * hexutil.Big {
534
- return (* hexutil .Big )(s .b .ChainConfig ().ChainID )
532
+ // ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
533
+ func (api * PublicBlockChainAPI ) ChainId () (* hexutil.Big , error ) {
534
+ // if current block is at or past the EIP-155 replay-protection fork block, return chainID from config
535
+ if config := api .b .ChainConfig (); config .IsEIP155 (api .b .CurrentBlock ().Number ()) {
536
+ return (* hexutil .Big )(config .ChainID ), nil
537
+ }
538
+ return nil , fmt .Errorf ("chain not synced beyond EIP-155 replay-protection fork block" )
535
539
}
536
540
537
541
// BlockNumber returns the block number of the chain head.
You can’t perform that action at this time.
0 commit comments