@@ -653,6 +653,11 @@ pub enum Event {
653653 /// The sender-intended sum total of all the MPP parts. This will be `None` for events
654654 /// serialized prior to LDK version 0.0.117.
655655 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 > ,
656661 } ,
657662 /// Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
658663 ///
@@ -1348,7 +1353,7 @@ impl Writeable for Event {
13481353 // We never write the OpenChannelRequest events as, upon disconnection, peers
13491354 // drop any channels which have not yet exchanged funding_signed.
13501355 } ,
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 } => {
13521357 19u8 . write ( writer) ?;
13531358 write_tlv_fields ! ( writer, {
13541359 ( 0 , payment_hash, required) ,
@@ -1357,6 +1362,7 @@ impl Writeable for Event {
13571362 ( 4 , amount_msat, required) ,
13581363 ( 5 , * htlcs, optional_vec) ,
13591364 ( 7 , sender_intended_total_msat, option) ,
1365+ ( 9 , onion_fields, option) ,
13601366 } ) ;
13611367 } ,
13621368 & Event :: ProbeSuccessful { ref payment_id, ref payment_hash, ref path } => {
@@ -1719,13 +1725,15 @@ impl MaybeReadable for Event {
17191725 let mut receiver_node_id = None ;
17201726 let mut htlcs: Option < Vec < ClaimedHTLC > > = Some ( vec ! [ ] ) ;
17211727 let mut sender_intended_total_msat: Option < u64 > = None ;
1728+ let mut onion_fields = None ;
17221729 read_tlv_fields ! ( reader, {
17231730 ( 0 , payment_hash, required) ,
17241731 ( 1 , receiver_node_id, option) ,
17251732 ( 2 , purpose, upgradable_required) ,
17261733 ( 4 , amount_msat, required) ,
17271734 ( 5 , htlcs, optional_vec) ,
17281735 ( 7 , sender_intended_total_msat, option) ,
1736+ ( 9 , onion_fields, option) ,
17291737 } ) ;
17301738 Ok ( Some ( Event :: PaymentClaimed {
17311739 receiver_node_id,
@@ -1734,6 +1742,7 @@ impl MaybeReadable for Event {
17341742 amount_msat,
17351743 htlcs : htlcs. unwrap_or ( vec ! [ ] ) ,
17361744 sender_intended_total_msat,
1745+ onion_fields,
17371746 } ) )
17381747 } ;
17391748 f ( )
0 commit comments