Skip to content

Commit

Permalink
internal: early exit if tx for getTxReceipt not found (ethereum#27712)
Browse files Browse the repository at this point in the history
internal/ethapi: fast exit if tx notfound
  • Loading branch information
jsvisa authored and devopsbo3 committed Nov 10, 2023
1 parent c5cd161 commit d927c53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Expand Up @@ -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
Expand Down

0 comments on commit d927c53

Please sign in to comment.