@@ -24,6 +24,7 @@ use crate::ln::channel::FUNDING_CONF_DEADLINE_BLOCKS;
24
24
use crate :: ln:: features:: ChannelTypeFeatures ;
25
25
use crate :: ln:: msgs;
26
26
use crate :: ln:: { ChannelId , PaymentPreimage , PaymentHash , PaymentSecret } ;
27
+ use crate :: chain:: transaction;
27
28
use crate :: routing:: gossip:: NetworkUpdate ;
28
29
use crate :: util:: errors:: APIError ;
29
30
use crate :: util:: ser:: { BigSize , FixedLengthReader , Writeable , Writer , MaybeReadable , Readable , RequiredWrapper , UpgradableRequired , WithoutLength } ;
@@ -861,7 +862,7 @@ pub enum Event {
861
862
///
862
863
/// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
863
864
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
864
- ChannelClosed {
865
+ ChannelClosed {
865
866
/// The `channel_id` of the channel which has been closed. Note that on-chain transactions
866
867
/// resolving the channel are likely still awaiting confirmation.
867
868
channel_id : ChannelId ,
@@ -886,6 +887,10 @@ pub enum Event {
886
887
///
887
888
/// This field will be `None` for objects serialized prior to LDK 0.0.117.
888
889
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 > ,
889
894
} ,
890
895
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
891
896
/// inputs for another purpose.
@@ -1091,7 +1096,7 @@ impl Writeable for Event {
1091
1096
} ) ;
1092
1097
} ,
1093
1098
& 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
1095
1100
} => {
1096
1101
9u8 . write ( writer) ?;
1097
1102
// `user_channel_id` used to be a single u64 value. In order to remain backwards
@@ -1106,6 +1111,7 @@ impl Writeable for Event {
1106
1111
( 3 , user_channel_id_high, required) ,
1107
1112
( 5 , counterparty_node_id, option) ,
1108
1113
( 7 , channel_capacity_sats, option) ,
1114
+ ( 9 , channel_funding_txo, option) ,
1109
1115
} ) ;
1110
1116
} ,
1111
1117
& Event :: DiscardFunding { ref channel_id, ref transaction } => {
@@ -1405,13 +1411,15 @@ impl MaybeReadable for Event {
1405
1411
let mut user_channel_id_high_opt: Option < u64 > = None ;
1406
1412
let mut counterparty_node_id = None ;
1407
1413
let mut channel_capacity_sats = None ;
1414
+ let mut channel_funding_txo = None ;
1408
1415
read_tlv_fields ! ( reader, {
1409
1416
( 0 , channel_id, required) ,
1410
1417
( 1 , user_channel_id_low_opt, option) ,
1411
1418
( 2 , reason, upgradable_required) ,
1412
1419
( 3 , user_channel_id_high_opt, option) ,
1413
1420
( 5 , counterparty_node_id, option) ,
1414
1421
( 7 , channel_capacity_sats, option) ,
1422
+ ( 9 , channel_funding_txo, option) ,
1415
1423
} ) ;
1416
1424
1417
1425
// `user_channel_id` used to be a single u64 value. In order to remain
@@ -1421,7 +1429,7 @@ impl MaybeReadable for Event {
1421
1429
( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
1422
1430
1423
1431
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 } ) )
1425
1433
} ;
1426
1434
f ( )
1427
1435
} ,
0 commit comments