Update docs and add pending changelog
authorElias Rohrer <ero@tnull.de>
Sat, 3 Dec 2022 06:06:22 +0000 (07:06 +0100)
committerElias Rohrer <ero@tnull.de>
Sun, 4 Dec 2022 16:44:39 +0000 (17:44 +0100)
lightning/src/util/events.rs
pending_changelog/elias-event-renaming.txt [new file with mode: 0644]

index 0e6de5d008524a14f4a7869cc48e7cb2b73e484e..28bd6978f6a5c9c7dad0563639e30a163bec5062 100644 (file)
@@ -350,8 +350,8 @@ pub enum Event {
                /// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
                user_channel_id: u128,
        },
-       /// Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
-       /// feed it to [`ChannelManager::claim_funds`] to get it....
+       /// Indicates that we've been offered a payment and it needs to be claimed via calling
+       /// [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
        ///
        /// Note that if the preimage is not known, you should call
        /// [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
@@ -364,15 +364,18 @@ pub enum Event {
        /// LDK will not stop an inbound payment from being paid multiple times, so multiple
        /// `PaymentClaimable` events may be generated for the same payment.
        ///
+       /// # Note
+       /// This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
+       ///
        /// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
        /// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
        PaymentClaimable {
-               /// The node that received the payment.
-               /// This is useful to identify payments which were received via [phantom node payments].
+               /// The node that will receive the payment after it has been claimed.
+               /// This is useful to identify payments received via [phantom nodes].
                /// This field will always be filled in when the event was generated by LDK versions
                /// 0.0.113 and above.
                ///
-               /// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
+               /// [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
                receiver_node_id: Option<PublicKey>,
                /// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
                /// not stop you from registering duplicate payment hashes for inbound payments.
@@ -403,18 +406,18 @@ pub enum Event {
        /// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
        PaymentClaimed {
                /// The node that received the payment.
-               /// This is useful to identify payments which were received via [phantom node payments].
+               /// This is useful to identify payments which were received via [phantom nodes].
                /// This field will always be filled in when the event was generated by LDK versions
                /// 0.0.113 and above.
                ///
-               /// [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
+               /// [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
                receiver_node_id: Option<PublicKey>,
                /// The payment hash of the claimed payment. Note that LDK will not stop you from
                /// registering duplicate payment hashes for inbound payments.
                payment_hash: PaymentHash,
                /// The value, in thousandths of a satoshi, that this payment is for.
                amount_msat: u64,
-               /// The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
+               /// The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
                /// spontaneous payment.
                purpose: PaymentPurpose,
        },
diff --git a/pending_changelog/elias-event-renaming.txt b/pending_changelog/elias-event-renaming.txt
new file mode 100644 (file)
index 0000000..c647296
--- /dev/null
@@ -0,0 +1,5 @@
+## API Updates
+
+## Backwards Compatibilty
+- The event formerly known as `PaymentReceived` is now called
+  `PaymentClaimable`.