From 632c0d22b5bc6c430cbf34cb283d94d2ffdde9d2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 5 Jun 2023 18:21:19 +0000 Subject: [PATCH 1/2] Remove spurious docs which imply you cannot retry a failed payment 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index 7abfbe4bf..14702986a 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -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( @@ -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`]. From 60ce627b239a2ed69667c74df80e2a926a523988 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 6 Jun 2023 00:44:06 +0000 Subject: [PATCH 2/2] Remove spurious double comma in documentation --- lightning-invoice/src/payment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs index 14702986a..bf161dbbf 100644 --- a/lightning-invoice/src/payment.rs +++ b/lightning-invoice/src/payment.rs @@ -108,7 +108,7 @@ where } /// Pays the given zero-value [`Invoice`] using the given amount and custom idempotency key, -/// , retrying if needed based on [`Retry`]. +/// retrying if needed based on [`Retry`]. /// /// Note that idempotency is only guaranteed as long as the payment is still pending. Once the /// payment completes or fails, no idempotency guarantees are made.