Skip to content

Commit 36c6245

Browse files
committed
f - add channel_type
1 parent 0ee0585 commit 36c6245

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lightning/src/events/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,8 @@ pub enum Event {
13401340
user_channel_id: u128,
13411341
/// The `node_id` of the channel counterparty.
13421342
counterparty_node_id: PublicKey,
1343+
/// The features that this channel will operate with.
1344+
channel_type: ChannelTypeFeatures,
13431345
},
13441346
/// Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
13451347
/// process of closure. This includes previously opened channels, and channels that time out from not being funded.
@@ -1865,12 +1867,13 @@ impl Writeable for Event {
18651867
(8, former_temporary_channel_id, required),
18661868
});
18671869
},
1868-
&Event::SpliceLocked { ref channel_id, ref user_channel_id, ref counterparty_node_id } => {
1870+
&Event::SpliceLocked { ref channel_id, ref user_channel_id, ref counterparty_node_id, ref channel_type } => {
18691871
45u8.write(writer)?;
18701872
write_tlv_fields!(writer, {
18711873
(0, channel_id, required),
18721874
(2, user_channel_id, required),
18731875
(4, counterparty_node_id, required),
1876+
(6, channel_type, required),
18741877
});
18751878
},
18761879
// Note that, going forward, all new events must only write data inside of
@@ -2394,16 +2397,19 @@ impl MaybeReadable for Event {
23942397
let mut channel_id = ChannelId::new_zero();
23952398
let mut user_channel_id: u128 = 0;
23962399
let mut counterparty_node_id = RequiredWrapper(None);
2400+
let mut channel_type = RequiredWrapper(None);
23972401
read_tlv_fields!(reader, {
23982402
(0, channel_id, required),
23992403
(2, user_channel_id, required),
24002404
(4, counterparty_node_id, required),
2405+
(6, channel_type, required),
24012406
});
24022407

24032408
Ok(Some(Event::SpliceLocked {
24042409
channel_id,
24052410
user_channel_id,
24062411
counterparty_node_id: counterparty_node_id.0.unwrap(),
2412+
channel_type: channel_type.0.unwrap()
24072413
}))
24082414
};
24092415
f()

lightning/src/ln/channelmanager.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9645,6 +9645,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96459645
channel_id: chan.context.channel_id(),
96469646
user_channel_id: chan.context.get_user_id(),
96479647
counterparty_node_id: chan.context.get_counterparty_node_id(),
9648+
channel_type: chan.funding.get_channel_type().clone(),
96489649
}, None));
96499650

96509651
log_trace!(logger, "Sending announcement_signatures for channel {}", chan.context.channel_id());
@@ -11791,6 +11792,7 @@ where
1179111792
channel_id: funded_channel.context.channel_id(),
1179211793
user_channel_id: funded_channel.context.get_user_id(),
1179311794
counterparty_node_id: funded_channel.context.get_counterparty_node_id(),
11795+
channel_type: funded_channel.funding.get_channel_type().clone(),
1179411796
}, None));
1179511797
}
1179611798

0 commit comments

Comments
 (0)