Remove spurious docs which imply you cannot retry a failed payment
authorMatt Corallo <git@bluematt.me>
Mon, 5 Jun 2023 18:21:19 +0000 (18:21 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 5 Jun 2023 23:53:45 +0000 (23:53 +0000)
If a payment (fully) fails, users are free to retry it, its only
once a payment succeeds that a user must never retry it.

lightning-invoice/src/payment.rs

index 7abfbe4bfc4e7201d03bcdabafcd023d28f7cb3a..14702986aaefad4868f287536cff5d36a4556b85 100644 (file)
@@ -28,8 +28,8 @@ use core::time::Duration;
 /// 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.
+/// as the payment is still pending. If the payment succeeds, 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`].
 pub fn pay_invoice<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
@@ -82,8 +82,8 @@ where
 /// [`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.
+/// as the payment is still pending. If the payment succeeds, 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_zero_value_invoice_with_id`].