Skip to content

Commit

Permalink
internal/ethapi: add error handling for invalid block hash (GetReceip…
Browse files Browse the repository at this point in the history
…tsByHash)
  • Loading branch information
cp-jhjin committed Mar 30, 2023
1 parent 05eb4a4 commit c2abe6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ func (s *PublicBlockChainAPI) GetReceiptsByHash(ctx context.Context, blockHash c
return nil, err1
}
block, err2 := s.b.BlockByHash(ctx, blockHash)
if err2 != nil {
if block == nil {
return nil, nil
} else if err2 != nil {
return nil, err2
}

Expand Down

0 comments on commit c2abe6a

Please sign in to comment.