Skip to content

Commit

Permalink
Merge pull request METADIUM#37 from cp-yoonjin/dev
Browse files Browse the repository at this point in the history
internal/ethapi: add error handling for invalid block hash (GetReceiptsByHash)
  • Loading branch information
wm-jsong1230 authored Mar 30, 2023
2 parents 05eb4a4 + c2abe6a commit 2406e43
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 2406e43

Please sign in to comment.