@@ -1318,6 +1318,29 @@ pub enum Event {
13181318 /// The features that this channel will operate with.
13191319 channel_type : ChannelTypeFeatures ,
13201320 } ,
1321+ /// Used to indicate that a channel with the given `channel_id` has had its funding spliced.
1322+ /// This event is emitted when the splice transaction has been confirmed on-chain to a
1323+ /// sufficient depth by both parties, or, in case of a 0-conf channel, when both parties have
1324+ /// completed negotiation of the splice transaction.
1325+ ///
1326+ /// # Failure Behavior and Persistence
1327+ /// This event will eventually be replayed after failures-to-handle (i.e., the event handler
1328+ /// returning `Err(ReplayEvent ())`) and will be persisted across restarts.
1329+ SpliceLocked {
1330+ /// The `channel_id` of the channel that had its funding spliced.
1331+ channel_id : ChannelId ,
1332+ /// The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
1333+ /// channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
1334+ /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
1335+ /// `user_channel_id` will be randomized for an inbound channel.
1336+ ///
1337+ /// [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
1338+ /// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
1339+ /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
1340+ user_channel_id : u128 ,
1341+ /// The `node_id` of the channel counterparty.
1342+ counterparty_node_id : PublicKey ,
1343+ } ,
13211344 /// Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
13221345 /// process of closure. This includes previously opened channels, and channels that time out from not being funded.
13231346 ///
@@ -1842,6 +1865,14 @@ impl Writeable for Event {
18421865 ( 8 , former_temporary_channel_id, required) ,
18431866 } ) ;
18441867 } ,
1868+ & Event :: SpliceLocked { ref channel_id, ref user_channel_id, ref counterparty_node_id } => {
1869+ 45u8 . write ( writer) ?;
1870+ write_tlv_fields ! ( writer, {
1871+ ( 0 , channel_id, required) ,
1872+ ( 2 , user_channel_id, required) ,
1873+ ( 4 , counterparty_node_id, required) ,
1874+ } ) ;
1875+ } ,
18451876 // Note that, going forward, all new events must only write data inside of
18461877 // `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
18471878 // data via `write_tlv_fields`.
@@ -2358,6 +2389,25 @@ impl MaybeReadable for Event {
23582389 former_temporary_channel_id : former_temporary_channel_id. 0 . unwrap ( ) ,
23592390 } ) )
23602391 } ,
2392+ 45u8 => {
2393+ let mut f = || {
2394+ let mut channel_id = ChannelId :: new_zero ( ) ;
2395+ let mut user_channel_id: u128 = 0 ;
2396+ let mut counterparty_node_id = RequiredWrapper ( None ) ;
2397+ read_tlv_fields ! ( reader, {
2398+ ( 0 , channel_id, required) ,
2399+ ( 2 , user_channel_id, required) ,
2400+ ( 4 , counterparty_node_id, required) ,
2401+ } ) ;
2402+
2403+ Ok ( Some ( Event :: SpliceLocked {
2404+ channel_id,
2405+ user_channel_id,
2406+ counterparty_node_id : counterparty_node_id. 0 . unwrap ( ) ,
2407+ } ) )
2408+ } ;
2409+ f ( )
2410+ } ,
23612411 // Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
23622412 // Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
23632413 // reads.
0 commit comments