From b2f8df0b61bd42e38e0f25c906726b5af9c49825 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Fri, 21 Oct 2022 11:05:18 +0200 Subject: [PATCH] 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()`). --- lightning/src/ln/channelmanager.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 { -- 2.30.2