From: Elias Rohrer Date: Fri, 21 Oct 2022 09:05:18 +0000 (+0200) Subject: Randomize `user_channel_id` for inbound channels X-Git-Tag: v0.0.113~41^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=b2f8df0b61bd42e38e0f25c906726b5af9c49825;p=rust-lightning Randomize `user_channel_id` for inbound channels Previously, all inbound channels defaulted to a `user_channel_id` of 0, which didn't allow for them being discerned on that basis. Here, we simply randomize the identifier to fix this and enable the use of `user_channel_id` as a true identifier for channels (assuming an equally reasonable value is chosen for outbound channels and given upon `create_channel()`). --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 465256d2..30aad9f0 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -1719,10 +1719,9 @@ impl ChannelManager 2**24 or `push_msat` is /// greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`. @@ -4604,9 +4603,13 @@ impl ChannelManager {