Update ethclient.go

This commit is contained in:
Felix Lange 2024-01-04 14:53:04 +01:00 committed by GitHub
parent 9c772165f7
commit 0924ae5d36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -306,13 +306,11 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash,
// Note that the receipt is not available for pending transactions. // Note that the receipt is not available for pending transactions.
func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
var r *types.Receipt var r *types.Receipt
if err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash); err != nil { err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash)
return nil, err if err == nil && r == nil {
}
if r == nil {
return nil, ethereum.NotFound return nil, ethereum.NotFound
} }
return r, nil return r, err
} }
// SyncProgress retrieves the current progress of the sync algorithm. If there's // SyncProgress retrieves the current progress of the sync algorithm. If there's