Skip to content

Commit 39739b0

Browse files
committed
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.
1 parent cdb6c3b commit 39739b0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lightning/src/ln/channelmanager.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,8 @@ pub struct ChannelDetails {
10871087
/// [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
10881088
pub unspendable_punishment_reserve: Option<u64>,
10891089
/// The `user_channel_id` passed in to create_channel, or a random value if the channel was
1090-
/// inbound.
1090+
/// inbound. This may be zero for inbound channels serialized with LDK versions prior to
1091+
/// 0.0.113.
10911092
pub user_channel_id: u128,
10921093
/// Our total balance. This is the amount we would get if we close the channel.
10931094
/// This value is not exact. Due to various in-flight changes and feerate changes, exactly this

lightning/src/util/events.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ pub enum Event {
319319
/// The script which should be used in the transaction output.
320320
output_script: Script,
321321
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
322-
/// random value for an inbound channel.
322+
/// random value for an inbound channel. This may be zero for objects serialized with LDK
323+
/// versions prior to 0.0.113.
323324
///
324325
/// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
325326
user_channel_id: u128,
@@ -632,8 +633,9 @@ pub enum Event {
632633
/// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
633634
/// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
634635
/// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
635-
/// `user_channel_id` will be randomized for an inbound channel.
636-
/// This will always be zero for objects serialized with LDK versions prior to 0.0.102.
636+
/// `user_channel_id` will be randomized for inbound channels.
637+
/// This may be zero for inbound channels serialized prior to 0.0.113 and will always be
638+
/// zero for objects serialized with LDK versions prior to 0.0.102.
637639
///
638640
/// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
639641
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel

0 commit comments

Comments
 (0)