From c72d630ada3cbff74beb52ce6338335a1a479741 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Wed, 16 Nov 2022 10:54:25 +0100 Subject: [PATCH] Mention `user_channel_id` rand. version req. As it was previously omitted, we clarify here starting from which version users can expect the `user_channel_id` to be randomized for inbound channels. --- lightning/src/ln/channelmanager.rs | 3 ++- lightning/src/util/events.rs | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 420547fb2..854ceef0a 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -1087,7 +1087,8 @@ pub struct ChannelDetails { /// [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat pub unspendable_punishment_reserve: Option, /// The `user_channel_id` passed in to create_channel, or a random value if the channel was - /// inbound. + /// inbound. This may be zero for inbound channels serialized with LDK versions prior to + /// 0.0.113. pub user_channel_id: u128, /// Our total balance. This is the amount we would get if we close the channel. /// This value is not exact. Due to various in-flight changes and feerate changes, exactly this diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index a06c7f1e3..3593cbf97 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -319,7 +319,8 @@ pub enum Event { /// The script which should be used in the transaction output. output_script: Script, /// The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a - /// random value for an inbound channel. + /// random value for an inbound channel. This may be zero for objects serialized with LDK + /// versions prior to 0.0.113. /// /// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel user_channel_id: u128, @@ -632,8 +633,9 @@ pub enum Event { /// The `user_channel_id` 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 will always be zero for objects serialized with LDK versions prior to 0.0.102. + /// `user_channel_id` will be randomized for inbound channels. + /// This may be zero for inbound channels serialized prior to 0.0.113 and will always be + /// zero for objects serialized with LDK versions prior to 0.0.102. /// /// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel /// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel -- 2.39.5