Skip to content

Commit 64524d4

Browse files
committed
Update docs and add pending changelog
1 parent f465396 commit 64524d4

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

lightning/src/util/events.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ pub enum Event {
350350
/// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
351351
user_channel_id: u128,
352352
},
353-
/// Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
354-
/// feed it to [`ChannelManager::claim_funds`] to get it....
353+
/// Indicates that a payment is inbound and needs to be claimed via calling
354+
/// [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
355355
///
356356
/// Note that if the preimage is not known, you should call
357357
/// [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
@@ -364,15 +364,18 @@ pub enum Event {
364364
/// LDK will not stop an inbound payment from being paid multiple times, so multiple
365365
/// `PaymentClaimable` events may be generated for the same payment.
366366
///
367+
/// # Note
368+
/// This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
369+
///
367370
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
368371
/// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
369372
PaymentClaimable {
370-
/// The node that received the payment.
371-
/// This is useful to identify payments which were received via [phantom node payments].
373+
/// The node that will receive the payment after it has been claimed.
374+
/// This is useful to identify payments received via [phantom nodes].
372375
/// This field will always be filled in when the event was generated by LDK versions
373376
/// 0.0.113 and above.
374377
///
375-
/// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
378+
/// [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
376379
receiver_node_id: Option<PublicKey>,
377380
/// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
378381
/// not stop you from registering duplicate payment hashes for inbound payments.
@@ -400,21 +403,24 @@ pub enum Event {
400403
/// [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
401404
/// multiple `PaymentReceived` events.
402405
///
406+
/// # Note
407+
/// This event used to be called `PaymentClaimed` in LDK versions 0.0.112 and earlier.
408+
///
403409
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
404410
PaymentReceived {
405411
/// The node that received the payment.
406-
/// This is useful to identify payments which were received via [phantom node payments].
412+
/// This is useful to identify payments which were received via [phantom nodes].
407413
/// This field will always be filled in when the event was generated by LDK versions
408414
/// 0.0.113 and above.
409415
///
410-
/// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
416+
/// [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
411417
receiver_node_id: Option<PublicKey>,
412-
/// The payment hash of the claimed payment. Note that LDK will not stop you from
418+
/// The payment hash of the received payment. Note that LDK will not stop you from
413419
/// registering duplicate payment hashes for inbound payments.
414420
payment_hash: PaymentHash,
415421
/// The value, in thousandths of a satoshi, that this payment is for.
416422
amount_msat: u64,
417-
/// The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
423+
/// The purpose of the received payment, i.e. whether the payment was for an invoice or a
418424
/// spontaneous payment.
419425
purpose: PaymentPurpose,
420426
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## API Updates
2+
3+
## Backwards Compatibilty
4+
- The event formerly known as `PaymentReceived` is now called
5+
`PaymentClaimable` and the event formerly known as `PaymentClaimed` is now
6+
called `PaymentReceived`.

0 commit comments

Comments
 (0)