@@ -750,7 +750,12 @@ pub enum Event {
750
750
/// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
751
751
user_channel_id : u128 ,
752
752
/// The reason the channel was closed.
753
- reason : ClosureReason
753
+ reason : ClosureReason ,
754
+ /// Counterparty in the closed channel.
755
+ counterparty_node_id : Option < PublicKey > ,
756
+ /// Value of the closing channel (sats).
757
+ channel_capacity : Option < u64 > ,
758
+
754
759
} ,
755
760
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
756
761
/// inputs for another purpose.
@@ -951,7 +956,7 @@ impl Writeable for Event {
951
956
( 5 , outbound_amount_forwarded_msat, option) ,
952
957
} ) ;
953
958
} ,
954
- & Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason } => {
959
+ & Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason, ref counterparty_node_id , ref channel_capacity } => {
955
960
9u8 . write ( writer) ?;
956
961
// `user_channel_id` used to be a single u64 value. In order to remain backwards
957
962
// compatible with versions prior to 0.0.113, the u128 is serialized as two
@@ -963,6 +968,8 @@ impl Writeable for Event {
963
968
( 1 , user_channel_id_low, required) ,
964
969
( 2 , reason, required) ,
965
970
( 3 , user_channel_id_high, required) ,
971
+ ( 5 , counterparty_node_id, option) ,
972
+ ( 7 , channel_capacity, option) ,
966
973
} ) ;
967
974
} ,
968
975
& Event :: DiscardFunding { ref channel_id, ref transaction } => {
@@ -1245,11 +1252,15 @@ impl MaybeReadable for Event {
1245
1252
let mut reason = UpgradableRequired ( None ) ;
1246
1253
let mut user_channel_id_low_opt: Option < u64 > = None ;
1247
1254
let mut user_channel_id_high_opt: Option < u64 > = None ;
1255
+ let mut counterparty_node_id = None ;
1256
+ let mut channel_capacity = None ;
1248
1257
read_tlv_fields ! ( reader, {
1249
1258
( 0 , channel_id, required) ,
1250
1259
( 1 , user_channel_id_low_opt, option) ,
1251
1260
( 2 , reason, upgradable_required) ,
1252
1261
( 3 , user_channel_id_high_opt, option) ,
1262
+ ( 5 , counterparty_node_id, option) ,
1263
+ ( 7 , channel_capacity, option) ,
1253
1264
} ) ;
1254
1265
1255
1266
// `user_channel_id` used to be a single u64 value. In order to remain
@@ -1258,7 +1269,8 @@ impl MaybeReadable for Event {
1258
1269
let user_channel_id = ( user_channel_id_low_opt. unwrap_or ( 0 ) as u128 ) +
1259
1270
( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
1260
1271
1261
- Ok ( Some ( Event :: ChannelClosed { channel_id, user_channel_id, reason : _init_tlv_based_struct_field ! ( reason, upgradable_required) } ) )
1272
+ Ok ( Some ( Event :: ChannelClosed { channel_id, user_channel_id, reason : _init_tlv_based_struct_field ! ( reason, upgradable_required) ,
1273
+ counterparty_node_id, channel_capacity } ) )
1262
1274
} ;
1263
1275
f ( )
1264
1276
} ,
0 commit comments