Skip to content

Commit

Permalink
internal/ethapi: add comment explaining return of nil instead of error (
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Sep 21, 2024
1 parent bdcfe72 commit b1cc785
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2223,6 +2223,8 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
tx, blockHash, blockNumber, index := core.GetTransaction(s.b.ChainDb(), hash)
if tx == nil {
// When the transaction doesn't exist, the RPC method should return JSON null
// as per specification.
return nil, nil
}
receipts, err := s.b.GetReceipts(ctx, blockHash)
Expand Down

0 comments on commit b1cc785

Please sign in to comment.