@@ -733,7 +733,12 @@ pub enum Event {
733
733
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
734
734
user_channel_id : u128 ,
735
735
/// The reason the channel was closed.
736
- reason : ClosureReason
736
+ reason : ClosureReason ,
737
+ /// Counterparty in the closed channel
738
+ counterparty_node_id : Option < PublicKey > ,
739
+ /// Value of the closing channel
740
+ channel_capacity : Option < u64 > ,
741
+
737
742
} ,
738
743
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
739
744
/// inputs for another purpose.
@@ -929,7 +934,7 @@ impl Writeable for Event {
929
934
( 5 , outbound_amount_forwarded_msat, option) ,
930
935
} ) ;
931
936
} ,
932
- & Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason } => {
937
+ & Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason, ref counterparty_node_id , ref channel_capacity } => {
933
938
9u8 . write ( writer) ?;
934
939
// `user_channel_id` used to be a single u64 value. In order to remain backwards
935
940
// compatible with versions prior to 0.0.113, the u128 is serialized as two
@@ -941,6 +946,8 @@ impl Writeable for Event {
941
946
( 1 , user_channel_id_low, required) ,
942
947
( 2 , reason, required) ,
943
948
( 3 , user_channel_id_high, required) ,
949
+ ( 5 , counterparty_node_id, option) ,
950
+ ( 7 , channel_capacity, option) ,
944
951
} ) ;
945
952
} ,
946
953
& Event :: DiscardFunding { ref channel_id, ref transaction } => {
@@ -1221,11 +1228,15 @@ impl MaybeReadable for Event {
1221
1228
let mut reason = UpgradableRequired ( None ) ;
1222
1229
let mut user_channel_id_low_opt: Option < u64 > = None ;
1223
1230
let mut user_channel_id_high_opt: Option < u64 > = None ;
1231
+ let mut counterparty_node_id = None ;
1232
+ let mut channel_capacity = None ;
1224
1233
read_tlv_fields ! ( reader, {
1225
1234
( 0 , channel_id, required) ,
1226
1235
( 1 , user_channel_id_low_opt, option) ,
1227
1236
( 2 , reason, upgradable_required) ,
1228
1237
( 3 , user_channel_id_high_opt, option) ,
1238
+ ( 5 , counterparty_node_id, option) ,
1239
+ ( 7 , channel_capacity, option) ,
1229
1240
} ) ;
1230
1241
1231
1242
// `user_channel_id` used to be a single u64 value. In order to remain
@@ -1234,7 +1245,7 @@ impl MaybeReadable for Event {
1234
1245
let user_channel_id = ( user_channel_id_low_opt. unwrap_or ( 0 ) as u128 ) +
1235
1246
( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
1236
1247
1237
- Ok ( Some ( Event :: ChannelClosed { channel_id, user_channel_id, reason : _init_tlv_based_struct_field ! ( reason, upgradable_required) } ) )
1248
+ Ok ( Some ( Event :: ChannelClosed { channel_id, user_channel_id, reason : _init_tlv_based_struct_field ! ( reason, upgradable_required) , counterparty_node_id , channel_capacity } ) )
1238
1249
} ;
1239
1250
f ( )
1240
1251
} ,
0 commit comments