diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 57617622415f..ebc56b3317e3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -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)