@@ -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.
867868 channel_id : ChannelId ,
@@ -886,6 +887,10 @@ pub enum Event {
886887 ///
887888 /// This field will be `None` for objects serialized prior to LDK 0.0.117.
888889 channel_capacity_sats : Option < u64 > ,
890+ /// The original channel funding TXO; this helps checking for the existence and confirmation
891+ /// status of the closing tx.
892+ /// Note that for instances serialized in v0.0.119 or prior this will be missing (None).
893+ channel_funding_txo : Option < transaction:: OutPoint > ,
889894 } ,
890895 /// Used to indicate to the user that they can abandon the funding transaction and recycle the
891896 /// inputs for another purpose.
@@ -1091,7 +1096,7 @@ impl Writeable for Event {
10911096 } ) ;
10921097 } ,
10931098 & Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason,
1094- ref counterparty_node_id, ref channel_capacity_sats
1099+ ref counterparty_node_id, ref channel_capacity_sats, ref channel_funding_txo
10951100 } => {
10961101 9u8 . write ( writer) ?;
10971102 // `user_channel_id` used to be a single u64 value. In order to remain backwards
@@ -1106,6 +1111,7 @@ impl Writeable for Event {
11061111 ( 3 , user_channel_id_high, required) ,
11071112 ( 5 , counterparty_node_id, option) ,
11081113 ( 7 , channel_capacity_sats, option) ,
1114+ ( 9 , channel_funding_txo, option) ,
11091115 } ) ;
11101116 } ,
11111117 & Event :: DiscardFunding { ref channel_id, ref transaction } => {
@@ -1405,13 +1411,15 @@ impl MaybeReadable for Event {
14051411 let mut user_channel_id_high_opt: Option < u64 > = None ;
14061412 let mut counterparty_node_id = None ;
14071413 let mut channel_capacity_sats = None ;
1414+ let mut channel_funding_txo = None ;
14081415 read_tlv_fields ! ( reader, {
14091416 ( 0 , channel_id, required) ,
14101417 ( 1 , user_channel_id_low_opt, option) ,
14111418 ( 2 , reason, upgradable_required) ,
14121419 ( 3 , user_channel_id_high_opt, option) ,
14131420 ( 5 , counterparty_node_id, option) ,
14141421 ( 7 , channel_capacity_sats, option) ,
1422+ ( 9 , channel_funding_txo, option) ,
14151423 } ) ;
14161424
14171425 // `user_channel_id` used to be a single u64 value. In order to remain
@@ -1421,7 +1429,7 @@ impl MaybeReadable for Event {
14211429 ( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
14221430
14231431 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 } ) )
1432+ counterparty_node_id, channel_capacity_sats, channel_funding_txo } ) )
14251433 } ;
14261434 f ( )
14271435 } ,
0 commit comments