From a52acd59b507fa7879df6c92ce8f9c7bd2d2c33c Mon Sep 17 00:00:00 2001 From: jsvisa Date: Thu, 13 Jul 2023 01:37:05 +0000 Subject: [PATCH] internal/ethapi: fast exit if tx notfound --- internal/ethapi/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index ec29cf28f0d7d..85df85d30acb1 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1681,7 +1681,7 @@ func (s *TransactionAPI) GetRawTransactionByHash(ctx context.Context, hash commo // GetTransactionReceipt returns the transaction receipt for the given transaction hash. func (s *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) { tx, blockHash, blockNumber, index, err := s.b.GetTransaction(ctx, hash) - if err != nil { + if tx == nil || err != nil { // When the transaction doesn't exist, the RPC method should return JSON null // as per specification. return nil, nil