From b6a713c683190bd0805a6d5eaf80a93fb3578cbf Mon Sep 17 00:00:00 2001 From: Dominic Zippilli Date: Fri, 22 Dec 2023 18:35:03 -0800 Subject: [PATCH] Make channel_type optional in ChannelOpenRequest event. Peers may send messages requesting to open a channel without specifying the channel type. This gets inferred by LDK when the channel actually opens, but can be passed to the event handler as an Option so the node may factor the lack of specificity in to the channel opening decision. This should fix #2804. --- lightning/src/events/mod.rs | 2 +- lightning/src/ln/channelmanager.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/events/mod.rs b/lightning/src/events/mod.rs index 32192297432..e79add8ca96 100644 --- a/lightning/src/events/mod.rs +++ b/lightning/src/events/mod.rs @@ -912,7 +912,7 @@ pub enum Event { /// or will be rejected otherwise. /// /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager - channel_type: ChannelTypeFeatures, + channel_type: Option, }, /// Indicates that the HTLC was accepted, but could not be processed when or after attempting to /// forward it. diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index c4efd895796..9541503c82f 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -6138,7 +6138,7 @@ where counterparty_node_id: counterparty_node_id.clone(), funding_satoshis: msg.funding_satoshis, push_msat: msg.push_msat, - channel_type: msg.channel_type.clone().unwrap(), + channel_type: msg.channel_type.clone(), }, None)); peer_state.inbound_channel_request_by_id.insert(channel_id, InboundChannelRequest { open_channel_msg: msg.clone(),