Skip to content

Commit 24e950d

Browse files
committed
f fix pay_pubkey_with_id docs missing change
1 parent d06f757 commit 24e950d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lightning-invoice/src/payment.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,14 @@ where
477477
.map(|()| payment_id)
478478
}
479479

480-
/// Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
481-
/// case a retry is needed.
480+
/// Pays `pubkey` an amount using the hash of the given preimage and a custom idempotency key,
481+
/// caching the invoice for later use in case a retry is needed.
482482
///
483-
/// The hash of the [`PaymentPreimage`] is used as the [`PaymentId`], which ensures idempotency
484-
/// as long as the payment is still pending. Once the payment completes or fails, you must
485-
/// ensure that a second payment with the same [`PaymentPreimage`] is never sent.
483+
/// Note that idempotency is only guaranteed as long as the payment is still pending. Once the
484+
/// payment completes or fails, no idempotency guarantees are made.
485+
///
486+
/// You should ensure that the [`PaymentPreimage`] is unique and the corresponding
487+
/// [`PaymentHash`] has never been paid before.
486488
pub fn pay_pubkey_with_id(
487489
&self, pubkey: PublicKey, payment_preimage: PaymentPreimage, payment_id: PaymentId,
488490
amount_msats: u64, final_cltv_expiry_delta: u32

0 commit comments

Comments
 (0)