internal/ethapi: remove unnecessary header read

This commit is contained in:
Gary Rong 2025-06-23 13:45:24 +08:00
parent 02c86786ad
commit 66106e2cf3

View file

@ -1382,17 +1382,12 @@ func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash commo
// No such tx. // No such tx.
return nil, nil return nil, nil
} }
header, err := api.b.HeaderByHash(ctx, blockHash)
if err != nil {
return nil, err
}
receipt, err := api.b.GetCanonicalReceipt(tx, blockHash, blockNumber, index) receipt, err := api.b.GetCanonicalReceipt(tx, blockHash, blockNumber, index)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// Derive the sender. // Derive the sender.
signer := types.MakeSigner(api.b.ChainConfig(), header.Number, header.Time) return marshalReceipt(receipt, blockHash, blockNumber, api.signer, tx, int(index)), nil
return marshalReceipt(receipt, blockHash, blockNumber, signer, tx, int(index)), nil
} }
// marshalReceipt marshals a transaction receipt into a JSON object. // marshalReceipt marshals a transaction receipt into a JSON object.