From 1835c244013198b62ab6fa59114de49aee96bdda Mon Sep 17 00:00:00 2001
From: Daniel Liu <liudaniel@qq.com>
Date: Tue, 25 Jun 2024 16:48:58 +0800
Subject: [PATCH] internal/ethapi: add comment explaining return of nil instead
 of error (#25097)

---
 internal/ethapi/api.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 57617622415ff..ebc56b3317e3c 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)