Skip to content

Commit

Permalink
fix(eth): handle nil case on geth.BlockByNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKetmo committed Jan 18, 2023
1 parent 5a21ac9 commit 7f02c13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethereum/execution/client/geth/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (c *Client) ChainID(ctx context.Context) (*big.Int, error) {
// finalizedBlock, err := s.core.ElClient().BlockByNumber(ctx, big.NewInt(int64(rpc.finalizedBlockNumber)))
func (c *Client) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
finalized := big.NewInt(int64(rpc.FinalizedBlockNumber))
if number.Cmp(finalized) == 0 {
if number != nil && number.Cmp(finalized) == 0 {
var raw json.RawMessage
if err := c.rpcclient.CallContext(ctx, &raw, "eth_getBlockByNumber", "finalized", true); err != nil {
return nil, err
Expand Down

0 comments on commit 7f02c13

Please sign in to comment.