@@ -733,7 +733,12 @@ pub enum Event {
733733 /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
734734 user_channel_id : u128 ,
735735 /// 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 (sats).
740+ channel_capacity : Option < u64 > ,
741+
737742 } ,
738743 /// Used to indicate to the user that they can abandon the funding transaction and recycle the
739744 /// inputs for another purpose.
@@ -929,7 +934,7 @@ impl Writeable for Event {
929934 ( 5 , outbound_amount_forwarded_msat, option) ,
930935 } ) ;
931936 } ,
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 } => {
933938 9u8 . write ( writer) ?;
934939 // `user_channel_id` used to be a single u64 value. In order to remain backwards
935940 // compatible with versions prior to 0.0.113, the u128 is serialized as two
@@ -941,6 +946,8 @@ impl Writeable for Event {
941946 ( 1 , user_channel_id_low, required) ,
942947 ( 2 , reason, required) ,
943948 ( 3 , user_channel_id_high, required) ,
949+ ( 5 , counterparty_node_id, option) ,
950+ ( 7 , channel_capacity, option) ,
944951 } ) ;
945952 } ,
946953 & Event :: DiscardFunding { ref channel_id, ref transaction } => {
@@ -1221,11 +1228,15 @@ impl MaybeReadable for Event {
12211228 let mut reason = UpgradableRequired ( None ) ;
12221229 let mut user_channel_id_low_opt: Option < u64 > = None ;
12231230 let mut user_channel_id_high_opt: Option < u64 > = None ;
1231+ let mut counterparty_node_id = None ;
1232+ let mut channel_capacity = None ;
12241233 read_tlv_fields ! ( reader, {
12251234 ( 0 , channel_id, required) ,
12261235 ( 1 , user_channel_id_low_opt, option) ,
12271236 ( 2 , reason, upgradable_required) ,
12281237 ( 3 , user_channel_id_high_opt, option) ,
1238+ ( 5 , counterparty_node_id, option) ,
1239+ ( 7 , channel_capacity, option) ,
12291240 } ) ;
12301241
12311242 // `user_channel_id` used to be a single u64 value. In order to remain
@@ -1234,7 +1245,8 @@ impl MaybeReadable for Event {
12341245 let user_channel_id = ( user_channel_id_low_opt. unwrap_or ( 0 ) as u128 ) +
12351246 ( ( user_channel_id_high_opt. unwrap_or ( 0 ) as u128 ) << 64 ) ;
12361247
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) ,
1249+ counterparty_node_id, channel_capacity } ) )
12381250 } ;
12391251 f ( )
12401252 } ,
0 commit comments