Skip to content

Commit c4524a0

Browse files
committed
Update PaymentPurpose's payment_preimage docs
Clarify that payment_preimage should only be used to claim a payment when handling Event::PaymentClaimable, not Event::PaymentClaimed.
1 parent e556428 commit c4524a0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lightning/src/events/mod.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ pub enum PaymentPurpose {
5353
/// A payment for a BOLT 11 invoice.
5454
Bolt11InvoicePayment {
5555
/// The preimage to the payment_hash, if the payment hash (and secret) were fetched via
56-
/// [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
57-
/// [`ChannelManager::claim_funds`].
56+
/// [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
57+
/// this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
58+
/// action is needed when seen in [`Event::PaymentClaimed`].
5859
///
5960
/// [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
6061
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
@@ -75,8 +76,9 @@ pub enum PaymentPurpose {
7576
///
7677
/// [`Offer`]: crate::offers::offer::Offer
7778
Bolt12OfferPayment {
78-
/// The preimage to the payment hash. If provided, this can be handed directly to
79-
/// [`ChannelManager::claim_funds`].
79+
/// The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
80+
/// passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
81+
/// when seen in [`Event::PaymentClaimed`].
8082
///
8183
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
8284
payment_preimage: Option<PaymentPreimage>,
@@ -96,8 +98,9 @@ pub enum PaymentPurpose {
9698
///
9799
/// [`Refund`]: crate::offers::refund::Refund
98100
Bolt12RefundPayment {
99-
/// The preimage to the payment hash. If provided, this can be handed directly to
100-
/// [`ChannelManager::claim_funds`].
101+
/// The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
102+
/// passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
103+
/// when seen in [`Event::PaymentClaimed`].
101104
///
102105
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
103106
payment_preimage: Option<PaymentPreimage>,

0 commit comments

Comments
 (0)