@@ -797,12 +797,24 @@ pub enum Event {
797797 /// This event is generated when a payment has been successfully forwarded through us and a
798798 /// forwarding fee earned.
799799 PaymentForwarded {
800- /// The incoming channel between the previous node and us. This is only `None` for events
801- /// generated or serialized by versions prior to 0.0.107.
800+ /// The channel id of the incoming channel between the previous node and us.
801+ ///
802+ /// This is only `None` for events generated or serialized by versions prior to 0.0.107.
802803 prev_channel_id : Option < ChannelId > ,
803- /// The outgoing channel between the next node and us. This is only `None` for events
804- /// generated or serialized by versions prior to 0.0.107.
804+ /// The channel id of the outgoing channel between the next node and us.
805+ ///
806+ /// This is only `None` for events generated or serialized by versions prior to 0.0.107.
805807 next_channel_id : Option < ChannelId > ,
808+ /// The `user_channel_id` of the incoming channel between the previous node and us.
809+ ///
810+ /// This is only `None` for events generated or serialized by versions prior to 0.0.122.
811+ prev_user_channel_id : Option < u128 > ,
812+ /// The `user_channel_id` of the outgoing channel between the next node and us.
813+ ///
814+ /// This will be `None` if the payment was settled via an on-chain transaction. See the
815+ /// caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
816+ /// events generated or serialized by versions prior to 0.0.122.
817+ next_user_channel_id : Option < u128 > ,
806818 /// The total fee, in milli-satoshis, which was earned as a result of the payment.
807819 ///
808820 /// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
@@ -1121,8 +1133,9 @@ impl Writeable for Event {
11211133 } ) ;
11221134 }
11231135 & Event :: PaymentForwarded {
1124- total_fee_earned_msat, prev_channel_id, claim_from_onchain_tx,
1125- next_channel_id, outbound_amount_forwarded_msat, skimmed_fee_msat,
1136+ prev_channel_id, next_channel_id, prev_user_channel_id, next_user_channel_id,
1137+ total_fee_earned_msat, skimmed_fee_msat, claim_from_onchain_tx,
1138+ outbound_amount_forwarded_msat,
11261139 } => {
11271140 7u8 . write ( writer) ?;
11281141 write_tlv_fields ! ( writer, {
@@ -1132,6 +1145,8 @@ impl Writeable for Event {
11321145 ( 3 , next_channel_id, option) ,
11331146 ( 5 , outbound_amount_forwarded_msat, option) ,
11341147 ( 7 , skimmed_fee_msat, option) ,
1148+ ( 9 , prev_user_channel_id, option) ,
1149+ ( 11 , next_user_channel_id, option) ,
11351150 } ) ;
11361151 } ,
11371152 & Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason,
@@ -1427,23 +1442,28 @@ impl MaybeReadable for Event {
14271442 } ,
14281443 7u8 => {
14291444 let f = || {
1430- let mut total_fee_earned_msat = None ;
14311445 let mut prev_channel_id = None ;
1432- let mut claim_from_onchain_tx = false ;
14331446 let mut next_channel_id = None ;
1434- let mut outbound_amount_forwarded_msat = None ;
1447+ let mut prev_user_channel_id = None ;
1448+ let mut next_user_channel_id = None ;
1449+ let mut total_fee_earned_msat = None ;
14351450 let mut skimmed_fee_msat = None ;
1451+ let mut claim_from_onchain_tx = false ;
1452+ let mut outbound_amount_forwarded_msat = None ;
14361453 read_tlv_fields ! ( reader, {
14371454 ( 0 , total_fee_earned_msat, option) ,
14381455 ( 1 , prev_channel_id, option) ,
14391456 ( 2 , claim_from_onchain_tx, required) ,
14401457 ( 3 , next_channel_id, option) ,
14411458 ( 5 , outbound_amount_forwarded_msat, option) ,
14421459 ( 7 , skimmed_fee_msat, option) ,
1460+ ( 9 , prev_user_channel_id, option) ,
1461+ ( 11 , next_user_channel_id, option) ,
14431462 } ) ;
14441463 Ok ( Some ( Event :: PaymentForwarded {
1445- total_fee_earned_msat, prev_channel_id, claim_from_onchain_tx, next_channel_id,
1446- outbound_amount_forwarded_msat, skimmed_fee_msat,
1464+ prev_channel_id, next_channel_id, prev_user_channel_id,
1465+ next_user_channel_id, total_fee_earned_msat, skimmed_fee_msat,
1466+ claim_from_onchain_tx, outbound_amount_forwarded_msat,
14471467 } ) )
14481468 } ;
14491469 f ( )
0 commit comments