@@ -797,12 +797,24 @@ pub enum Event {
797
797
/// This event is generated when a payment has been successfully forwarded through us and a
798
798
/// forwarding fee earned.
799
799
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.
802
803
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.
805
807
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 > ,
806
818
/// The total fee, in milli-satoshis, which was earned as a result of the payment.
807
819
///
808
820
/// 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 {
1121
1133
} ) ;
1122
1134
}
1123
1135
& 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,
1126
1139
} => {
1127
1140
7u8 . write ( writer) ?;
1128
1141
write_tlv_fields ! ( writer, {
@@ -1132,6 +1145,8 @@ impl Writeable for Event {
1132
1145
( 3 , next_channel_id, option) ,
1133
1146
( 5 , outbound_amount_forwarded_msat, option) ,
1134
1147
( 7 , skimmed_fee_msat, option) ,
1148
+ ( 9 , prev_user_channel_id, option) ,
1149
+ ( 11 , next_user_channel_id, option) ,
1135
1150
} ) ;
1136
1151
} ,
1137
1152
& Event :: ChannelClosed { ref channel_id, ref user_channel_id, ref reason,
@@ -1427,23 +1442,28 @@ impl MaybeReadable for Event {
1427
1442
} ,
1428
1443
7u8 => {
1429
1444
let f = || {
1430
- let mut total_fee_earned_msat = None ;
1431
1445
let mut prev_channel_id = None ;
1432
- let mut claim_from_onchain_tx = false ;
1433
1446
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 ;
1435
1450
let mut skimmed_fee_msat = None ;
1451
+ let mut claim_from_onchain_tx = false ;
1452
+ let mut outbound_amount_forwarded_msat = None ;
1436
1453
read_tlv_fields ! ( reader, {
1437
1454
( 0 , total_fee_earned_msat, option) ,
1438
1455
( 1 , prev_channel_id, option) ,
1439
1456
( 2 , claim_from_onchain_tx, required) ,
1440
1457
( 3 , next_channel_id, option) ,
1441
1458
( 5 , outbound_amount_forwarded_msat, option) ,
1442
1459
( 7 , skimmed_fee_msat, option) ,
1460
+ ( 9 , prev_user_channel_id, option) ,
1461
+ ( 11 , next_user_channel_id, option) ,
1443
1462
} ) ;
1444
1463
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,
1447
1467
} ) )
1448
1468
} ;
1449
1469
f ( )
0 commit comments