Function lightning_invoice::payment::pay_invoice
source · pub fn pay_invoice<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
invoice: &Invoice,
retry_strategy: Retry,
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
) -> Result<PaymentId, PaymentError>where
M::Target: Watch<<SP::Target as SignerProvider>::Signer>,
T::Target: BroadcasterInterface,
ES::Target: EntropySource,
NS::Target: NodeSigner,
SP::Target: SignerProvider,
F::Target: FeeEstimator,
R::Target: Router,
L::Target: Logger,
Expand description
Pays the given Invoice
, retrying if needed based on Retry
.
Invoice::payment_hash
is used as the PaymentId
, which ensures idempotency as long
as the payment is still pending. Once the payment completes or fails, you must ensure that
a second payment with the same PaymentHash
is never sent.
If you wish to use a different payment idempotency token, see pay_invoice_with_id
.