From a133fc752aeb7d77cc01a64aecca4d8effea5ad4 Mon Sep 17 00:00:00 2001 From: pengin7384 Date: Sun, 28 Apr 2024 18:48:28 +0900 Subject: [PATCH] internal/ethapi: call GetReceipt instead of GetReceipts in GetTransactionReceipt API --- internal/ethapi/api.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 0ecedf1130..08e86223f3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1691,14 +1691,13 @@ func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash commo if err != nil { return nil, err } - receipts, err := api.b.GetReceipts(ctx, blockHash) + receipt, err := api.b.GetReceipt(ctx, hash) if err != nil { return nil, err } - if uint64(len(receipts)) <= index { + if receipt == nil { return nil, nil } - receipt := receipts[index] // Derive the sender. signer := types.MakeSigner(api.b.ChainConfig(), header.Number, header.Time)