@@ -21,7 +21,7 @@ pub mod bump_transaction;
21
21
pub use bump_transaction:: BumpTransactionEvent ;
22
22
23
23
use crate :: chain:: keysinterface:: SpendableOutputDescriptor ;
24
- use crate :: ln:: channelmanager:: { InterceptId , PaymentId } ;
24
+ use crate :: ln:: channelmanager:: { InterceptId , PaymentId , RecipientOnionFields } ;
25
25
use crate :: ln:: channel:: FUNDING_CONF_DEADLINE_BLOCKS ;
26
26
use crate :: ln:: features:: ChannelTypeFeatures ;
27
27
use crate :: ln:: msgs;
@@ -342,6 +342,11 @@ pub enum Event {
342
342
/// The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
343
343
/// not stop you from registering duplicate payment hashes for inbound payments.
344
344
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 > ,
345
350
/// The value, in thousandths of a satoshi, that this payment is for.
346
351
amount_msat : u64 ,
347
352
/// Information for claiming this received payment, based on whether the purpose of the
@@ -780,7 +785,10 @@ impl Writeable for Event {
780
785
// We never write out FundingGenerationReady events as, upon disconnection, peers
781
786
// drop any channels which have not yet exchanged funding_signed.
782
787
} ,
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
+ } => {
784
792
1u8 . write ( writer) ?;
785
793
let mut payment_secret = None ;
786
794
let payment_preimage;
@@ -803,6 +811,7 @@ impl Writeable for Event {
803
811
( 6 , 0u64 , required) , // user_payment_id required for compatibility with 0.0.103 and earlier
804
812
( 7 , claim_deadline, option) ,
805
813
( 8 , payment_preimage, option) ,
814
+ ( 9 , onion_fields, option) ,
806
815
} ) ;
807
816
} ,
808
817
& Event :: PaymentSent { ref payment_id, ref payment_preimage, ref payment_hash, ref fee_paid_msat } => {
@@ -1002,6 +1011,7 @@ impl MaybeReadable for Event {
1002
1011
let mut via_channel_id = None ;
1003
1012
let mut claim_deadline = None ;
1004
1013
let mut via_user_channel_id = None ;
1014
+ let mut onion_fields = None ;
1005
1015
read_tlv_fields ! ( reader, {
1006
1016
( 0 , payment_hash, required) ,
1007
1017
( 1 , receiver_node_id, option) ,
@@ -1012,6 +1022,7 @@ impl MaybeReadable for Event {
1012
1022
( 6 , _user_payment_id, option) ,
1013
1023
( 7 , claim_deadline, option) ,
1014
1024
( 8 , payment_preimage, option) ,
1025
+ ( 9 , onion_fields, option) ,
1015
1026
} ) ;
1016
1027
let purpose = match payment_secret {
1017
1028
Some ( secret) => PaymentPurpose :: InvoicePayment {
@@ -1029,6 +1040,7 @@ impl MaybeReadable for Event {
1029
1040
via_channel_id,
1030
1041
via_user_channel_id,
1031
1042
claim_deadline,
1043
+ onion_fields,
1032
1044
} ) )
1033
1045
} ;
1034
1046
f ( )
0 commit comments