Skip to content

Commit

Permalink
Cherry-pick: Nil-Ptr in CurrentHeader (#11807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 authored Sep 1, 2024
1 parent fbc4122 commit 801aa1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions turbo/execution/eth1/getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ func (e *EthereumExecutionModule) CurrentHeader(ctx context.Context, _ *emptypb.
defer tx.Rollback()
hash := rawdb.ReadHeadHeaderHash(tx)
number := rawdb.ReadHeaderNumber(tx, hash)
if number == nil {
return nil, errors.New("ethereumExecutionModule.CurrentHeader: no current header yet - probabably node not synced yet")
}
h, err := e.blockReader.Header(ctx, tx, hash, *number)
if err != nil {
return nil, fmt.Errorf("ethereumExecutionModule.CurrentHeader: blockReader.Header error %w", err)
Expand Down

0 comments on commit 801aa1b

Please sign in to comment.