+/// Information about an HTLC that is part of a payment that can be claimed.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct ClaimedHTLC {
+ /// The `channel_id` of the channel over which the HTLC was received.
+ pub channel_id: ChannelId,
+ /// The `user_channel_id` of the channel over which the HTLC was received. This is the value
+ /// passed in to [`ChannelManager::create_channel`] for outbound channels, or to
+ /// [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ /// `user_channel_id` will be randomized for an inbound channel.
+ ///
+ /// This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
+ /// should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
+ /// was not actually claimed until after upgrading.)
+ ///
+ /// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ /// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ pub user_channel_id: u128,
+ /// The block height at which this HTLC expires.
+ pub cltv_expiry: u32,
+ /// The amount (in msats) of this part of an MPP.
+ pub value_msat: u64,
+}
+impl_writeable_tlv_based!(ClaimedHTLC, {
+ (0, channel_id, required),
+ (2, user_channel_id, required),
+ (4, cltv_expiry, required),
+ (6, value_msat, required),
+});
+