@@ -653,6 +653,11 @@ pub enum Event {
653
653
/// The sender-intended sum total of all the MPP parts. This will be `None` for events
654
654
/// serialized prior to LDK version 0.0.117.
655
655
sender_intended_total_msat : Option < u64 > ,
656
+ /// The fields in the onion which were received with each HTLC. Only fields which were
657
+ /// identical in each HTLC involved in the payment will be included here.
658
+ ///
659
+ /// Payments received on LDK versions prior to 0.0.124 will have this field unset.
660
+ onion_fields : Option < RecipientOnionFields > ,
656
661
} ,
657
662
/// Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
658
663
///
@@ -1348,7 +1353,7 @@ impl Writeable for Event {
1348
1353
// We never write the OpenChannelRequest events as, upon disconnection, peers
1349
1354
// drop any channels which have not yet exchanged funding_signed.
1350
1355
} ,
1351
- & Event :: PaymentClaimed { ref payment_hash, ref amount_msat, ref purpose, ref receiver_node_id, ref htlcs, ref sender_intended_total_msat } => {
1356
+ & Event :: PaymentClaimed { ref payment_hash, ref amount_msat, ref purpose, ref receiver_node_id, ref htlcs, ref sender_intended_total_msat, ref onion_fields } => {
1352
1357
19u8 . write ( writer) ?;
1353
1358
write_tlv_fields ! ( writer, {
1354
1359
( 0 , payment_hash, required) ,
@@ -1357,6 +1362,7 @@ impl Writeable for Event {
1357
1362
( 4 , amount_msat, required) ,
1358
1363
( 5 , * htlcs, optional_vec) ,
1359
1364
( 7 , sender_intended_total_msat, option) ,
1365
+ ( 9 , onion_fields, option) ,
1360
1366
} ) ;
1361
1367
} ,
1362
1368
& Event :: ProbeSuccessful { ref payment_id, ref payment_hash, ref path } => {
@@ -1719,13 +1725,15 @@ impl MaybeReadable for Event {
1719
1725
let mut receiver_node_id = None ;
1720
1726
let mut htlcs: Option < Vec < ClaimedHTLC > > = Some ( vec ! [ ] ) ;
1721
1727
let mut sender_intended_total_msat: Option < u64 > = None ;
1728
+ let mut onion_fields = None ;
1722
1729
read_tlv_fields ! ( reader, {
1723
1730
( 0 , payment_hash, required) ,
1724
1731
( 1 , receiver_node_id, option) ,
1725
1732
( 2 , purpose, upgradable_required) ,
1726
1733
( 4 , amount_msat, required) ,
1727
1734
( 5 , htlcs, optional_vec) ,
1728
1735
( 7 , sender_intended_total_msat, option) ,
1736
+ ( 9 , onion_fields, option) ,
1729
1737
} ) ;
1730
1738
Ok ( Some ( Event :: PaymentClaimed {
1731
1739
receiver_node_id,
@@ -1734,6 +1742,7 @@ impl MaybeReadable for Event {
1734
1742
amount_msat,
1735
1743
htlcs : htlcs. unwrap_or ( vec ! [ ] ) ,
1736
1744
sender_intended_total_msat,
1745
+ onion_fields,
1737
1746
} ) )
1738
1747
} ;
1739
1748
f ( )
0 commit comments