@@ -199,6 +199,10 @@ pub enum Event {
199199 funding_txo : OutPoint ,
200200 } ,
201201 /// A channel is ready to be used.
202+ ///
203+ /// This event is emitted when:
204+ /// - A new channel has been established and is ready for use
205+ /// - An existing channel has been spliced and is ready with the new funding output
202206 ChannelReady {
203207 /// The `channel_id` of the channel.
204208 channel_id : ChannelId ,
@@ -208,6 +212,14 @@ pub enum Event {
208212 ///
209213 /// This will be `None` for events serialized by LDK Node v0.1.0 and prior.
210214 counterparty_node_id : Option < PublicKey > ,
215+ /// The outpoint of the channel's funding transaction.
216+ ///
217+ /// This represents the channel's current funding output, which may change when the
218+ /// channel is spliced. For spliced channels, this will contain the new funding output
219+ /// from the confirmed splice transaction.
220+ ///
221+ /// This will be `None` for events serialized by LDK Node v0.6.0 and prior.
222+ funding_txo : Option < OutPoint > ,
211223 } ,
212224 /// A channel has been closed.
213225 ChannelClosed {
@@ -246,6 +258,7 @@ impl_writeable_tlv_based_enum!(Event,
246258 ( 0 , channel_id, required) ,
247259 ( 1 , counterparty_node_id, option) ,
248260 ( 2 , user_channel_id, required) ,
261+ ( 3 , funding_txo, option) ,
249262 } ,
250263 ( 4 , ChannelPending ) => {
251264 ( 0 , channel_id, required) ,
@@ -1397,14 +1410,28 @@ where
13971410 }
13981411 } ,
13991412 LdkEvent :: ChannelReady {
1400- channel_id, user_channel_id, counterparty_node_id, ..
1413+ channel_id,
1414+ user_channel_id,
1415+ counterparty_node_id,
1416+ funding_txo,
1417+ ..
14011418 } => {
1402- log_info ! (
1403- self . logger,
1404- "Channel {} with counterparty {} ready to be used." ,
1405- channel_id,
1406- counterparty_node_id,
1407- ) ;
1419+ if let Some ( funding_txo) = funding_txo {
1420+ log_info ! (
1421+ self . logger,
1422+ "Channel {} with counterparty {} ready to be used with funding_txo {}" ,
1423+ channel_id,
1424+ counterparty_node_id,
1425+ funding_txo,
1426+ ) ;
1427+ } else {
1428+ log_info ! (
1429+ self . logger,
1430+ "Channel {} with counterparty {} ready to be used" ,
1431+ channel_id,
1432+ counterparty_node_id,
1433+ ) ;
1434+ }
14081435
14091436 if let Some ( liquidity_source) = self . liquidity_source . as_ref ( ) {
14101437 liquidity_source
@@ -1416,6 +1443,7 @@ where
14161443 channel_id,
14171444 user_channel_id : UserChannelId ( user_channel_id) ,
14181445 counterparty_node_id : Some ( counterparty_node_id) ,
1446+ funding_txo,
14191447 } ;
14201448 match self . event_queue . add_event ( event) . await {
14211449 Ok ( _) => { } ,
@@ -1655,6 +1683,7 @@ mod tests {
16551683 channel_id : ChannelId ( [ 23u8 ; 32 ] ) ,
16561684 user_channel_id : UserChannelId ( 2323 ) ,
16571685 counterparty_node_id : None ,
1686+ funding_txo : None ,
16581687 } ;
16591688 event_queue. add_event ( expected_event. clone ( ) ) . await . unwrap ( ) ;
16601689
@@ -1692,6 +1721,7 @@ mod tests {
16921721 channel_id : ChannelId ( [ 23u8 ; 32 ] ) ,
16931722 user_channel_id : UserChannelId ( 2323 ) ,
16941723 counterparty_node_id : None ,
1724+ funding_txo : None ,
16951725 } ;
16961726
16971727 // Check `next_event_async` won't return if the queue is empty and always rather timeout.
0 commit comments