@@ -24,6 +24,7 @@ use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
2424use  crate :: ln:: features:: ChannelTypeFeatures ; 
2525use  crate :: ln:: msgs; 
2626use  crate :: ln:: { ChannelId ,  PaymentPreimage ,  PaymentHash ,  PaymentSecret } ; 
27+ use  crate :: chain:: transaction; 
2728use  crate :: routing:: gossip:: NetworkUpdate ; 
2829use  crate :: util:: errors:: APIError ; 
2930use  crate :: util:: ser:: { BigSize ,  FixedLengthReader ,  Writeable ,  Writer ,  MaybeReadable ,  Readable ,  RequiredWrapper ,  UpgradableRequired ,  WithoutLength } ; 
@@ -861,7 +862,7 @@ pub enum Event {
861862/// 
862863/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel 
863864/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels 
864- ChannelClosed    { 
865+ ChannelClosed  { 
865866		/// The `channel_id` of the channel which has been closed. Note that on-chain transactions 
866867/// resolving the channel are likely still awaiting confirmation. 
867868channel_id :  ChannelId , 
@@ -886,6 +887,8 @@ pub enum Event {
886887/// 
887888/// This field will be `None` for objects serialized prior to LDK 0.0.117. 
888889channel_capacity_sats :  Option < u64 > , 
890+ 		/// The original channel funding TXO; this helps checking for the existence and confirmation status of the closing tx 
891+ channel_funding_txo :  Option < transaction:: OutPoint > , 
889892	} , 
890893	/// Used to indicate to the user that they can abandon the funding transaction and recycle the 
891894/// inputs for another purpose. 
@@ -1091,7 +1094,7 @@ impl Writeable for Event {
10911094				} ) ; 
10921095			} , 
10931096			& Event :: ChannelClosed  {  ref  channel_id,  ref  user_channel_id,  ref  reason, 
1094- 				ref  counterparty_node_id,  ref  channel_capacity_sats
1097+ 				ref  counterparty_node_id,  ref  channel_capacity_sats,   ref  channel_funding_txo 
10951098			}  => { 
10961099				9u8 . write ( writer) ?; 
10971100				// `user_channel_id` used to be a single u64 value. In order to remain backwards 
@@ -1106,6 +1109,7 @@ impl Writeable for Event {
11061109					( 3 ,  user_channel_id_high,  required) , 
11071110					( 5 ,  counterparty_node_id,  option) , 
11081111					( 7 ,  channel_capacity_sats,  option) , 
1112+ 					( 9 ,  channel_funding_txo,  option) , 
11091113				} ) ; 
11101114			} , 
11111115			& Event :: DiscardFunding  {  ref  channel_id,  ref  transaction }  => { 
@@ -1405,13 +1409,15 @@ impl MaybeReadable for Event {
14051409					let  mut  user_channel_id_high_opt:  Option < u64 >  = None ; 
14061410					let  mut  counterparty_node_id = None ; 
14071411					let  mut  channel_capacity_sats = None ; 
1412+ 					let  mut  channel_funding_txo = None ; 
14081413					read_tlv_fields ! ( reader,  { 
14091414						( 0 ,  channel_id,  required) , 
14101415						( 1 ,  user_channel_id_low_opt,  option) , 
14111416						( 2 ,  reason,  upgradable_required) , 
14121417						( 3 ,  user_channel_id_high_opt,  option) , 
14131418						( 5 ,  counterparty_node_id,  option) , 
14141419						( 7 ,  channel_capacity_sats,  option) , 
1420+ 						( 9 ,  channel_funding_txo,  option) , 
14151421					} ) ; 
14161422
14171423					// `user_channel_id` used to be a single u64 value. In order to remain 
@@ -1421,7 +1427,7 @@ impl MaybeReadable for Event {
14211427						( ( user_channel_id_high_opt. unwrap_or ( 0 )  as  u128 )  << 64 ) ; 
14221428
14231429					Ok ( Some ( Event :: ChannelClosed  {  channel_id,  user_channel_id,  reason :  _init_tlv_based_struct_field ! ( reason,  upgradable_required) , 
1424- 						counterparty_node_id,  channel_capacity_sats } ) ) 
1430+ 						counterparty_node_id,  channel_capacity_sats,  channel_funding_txo  } ) ) 
14251431				} ; 
14261432				f ( ) 
14271433			} , 
0 commit comments