Skip to content

Commit

Permalink
erigon_getBlockByTimestamp() add check on header == null on e3 (#11918)…
Browse files Browse the repository at this point in the history
… (#12074)

cherry-pick of PR #11918 on e2
  • Loading branch information
lupin012 authored Sep 24, 2024
1 parent 6d975a9 commit b266c65
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions turbo/jsonrpc/erigon_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ func (api *ErigonImpl) GetBlockByTimestamp(ctx context.Context, timeStamp rpc.Ti
uintTimestamp := timeStamp.TurnIntoUint64()

currentHeader := rawdb.ReadCurrentHeader(tx)
if currentHeader == nil {
return nil, errors.New("current header not found")
}
currentHeaderTime := currentHeader.Time
highestNumber := currentHeader.Number.Uint64()

Expand Down

0 comments on commit b266c65

Please sign in to comment.