@@ -21,7 +21,7 @@ pub mod bump_transaction;
2121pub use bump_transaction:: BumpTransactionEvent ;
2222
2323use crate :: chain:: keysinterface:: SpendableOutputDescriptor ;
24- use crate :: ln:: channelmanager:: { InterceptId , PaymentId } ;
24+ use crate :: ln:: channelmanager:: { InterceptId , PaymentId , RecipientOnionFields } ;
2525use crate :: ln:: channel:: FUNDING_CONF_DEADLINE_BLOCKS ;
2626use crate :: ln:: features:: ChannelTypeFeatures ;
2727use crate :: ln:: msgs;
@@ -342,6 +342,11 @@ pub enum Event {
342342 /// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
343343 /// not stop you from registering duplicate payment hashes for inbound payments.
344344 payment_hash : PaymentHash ,
345+ /// The fields in the onion which were received with each HTLC. Only fields which were
346+ /// identical in each HTLC involved in the payment will be included here.
347+ ///
348+ /// Payments received on LDK versions prior to 0.0.115 will have this field unset.
349+ onion_fields : Option < RecipientOnionFields > ,
345350 /// The value, in thousandths of a satoshi, that this payment is for.
346351 amount_msat : u64 ,
347352 /// Information for claiming this received payment, based on whether the purpose of the
@@ -780,7 +785,10 @@ impl Writeable for Event {
780785 // We never write out FundingGenerationReady events as, upon disconnection, peers
781786 // drop any channels which have not yet exchanged funding_signed.
782787 } ,
783- & Event :: PaymentClaimable { ref payment_hash, ref amount_msat, ref purpose, ref receiver_node_id, ref via_channel_id, ref via_user_channel_id, ref claim_deadline } => {
788+ & Event :: PaymentClaimable { ref payment_hash, ref amount_msat, ref purpose,
789+ ref receiver_node_id, ref via_channel_id, ref via_user_channel_id,
790+ ref claim_deadline, ref onion_fields
791+ } => {
784792 1u8 . write ( writer) ?;
785793 let mut payment_secret = None ;
786794 let payment_preimage;
@@ -803,6 +811,7 @@ impl Writeable for Event {
803811 ( 6 , 0u64 , required) , // user_payment_id required for compatibility with 0.0.103 and earlier
804812 ( 7 , claim_deadline, option) ,
805813 ( 8 , payment_preimage, option) ,
814+ ( 9 , onion_fields, option) ,
806815 } ) ;
807816 } ,
808817 & Event :: PaymentSent { ref payment_id, ref payment_preimage, ref payment_hash, ref fee_paid_msat } => {
@@ -1002,6 +1011,7 @@ impl MaybeReadable for Event {
10021011 let mut via_channel_id = None ;
10031012 let mut claim_deadline = None ;
10041013 let mut via_user_channel_id = None ;
1014+ let mut onion_fields = None ;
10051015 read_tlv_fields ! ( reader, {
10061016 ( 0 , payment_hash, required) ,
10071017 ( 1 , receiver_node_id, option) ,
@@ -1012,6 +1022,7 @@ impl MaybeReadable for Event {
10121022 ( 6 , _user_payment_id, option) ,
10131023 ( 7 , claim_deadline, option) ,
10141024 ( 8 , payment_preimage, option) ,
1025+ ( 9 , onion_fields, option) ,
10151026 } ) ;
10161027 let purpose = match payment_secret {
10171028 Some ( secret) => PaymentPurpose :: InvoicePayment {
@@ -1029,6 +1040,7 @@ impl MaybeReadable for Event {
10291040 via_channel_id,
10301041 via_user_channel_id,
10311042 claim_deadline,
1043+ onion_fields,
10321044 } ) )
10331045 } ;
10341046 f ( )
0 commit comments