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 2, 2024
1 parent dc378de commit 096fb28
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 096fb28

Please sign in to comment.