Skip to content

Commit 5786139

Browse files
committed
Add more information to OpenChannelRequest Event
1 parent 9a438ee commit 5786139

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lightning/src/events/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,10 @@ pub enum Event {
11131113
///
11141114
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11151115
channel_type: ChannelTypeFeatures,
1116+
/// True if this channel is (or will be) publicly-announced.
1117+
is_public: bool,
1118+
/// Opening fields for the channel given by the counterparty.
1119+
open_fields: msgs::CommonOpenChannelFields,
11161120
},
11171121
/// Indicates that the HTLC was accepted, but could not be processed when or after attempting to
11181122
/// forward it.

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7169,12 +7169,15 @@ where
71697169
MsgHandleErrInternal::from_chan_no_close(e, msg.common_fields.temporary_channel_id)
71707170
)?;
71717171
let mut pending_events = self.pending_events.lock().unwrap();
7172+
let is_public = (msg.common_fields.channel_flags & 1) == 1;
71727173
pending_events.push_back((events::Event::OpenChannelRequest {
71737174
temporary_channel_id: msg.common_fields.temporary_channel_id.clone(),
71747175
counterparty_node_id: counterparty_node_id.clone(),
71757176
funding_satoshis: msg.common_fields.funding_satoshis,
71767177
push_msat: msg.push_msat,
71777178
channel_type,
7179+
is_public,
7180+
open_fields: msg.common_fields.clone(),
71787181
}, None));
71797182
peer_state.inbound_channel_request_by_id.insert(channel_id, InboundChannelRequest {
71807183
open_channel_msg: msg.clone(),

0 commit comments

Comments
 (0)