@@ -2512,6 +2512,7 @@ pub struct PassAlongPathArgs<'a, 'b, 'c, 'd> {
25122512 pub clear_recipient_events : bool ,
25132513 pub expected_preimage : Option < PaymentPreimage > ,
25142514 pub is_probe : bool ,
2515+ pub custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
25152516}
25162517
25172518impl < ' a , ' b , ' c , ' d > PassAlongPathArgs < ' a , ' b , ' c , ' d > {
@@ -2522,7 +2523,7 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
25222523 Self {
25232524 origin_node, expected_path, recv_value, payment_hash, payment_secret : None , event,
25242525 payment_claimable_expected : true , clear_recipient_events : true , expected_preimage : None ,
2525- is_probe : false ,
2526+ is_probe : false , custom_tlvs : Vec :: new ( ) ,
25262527 }
25272528 }
25282529 pub fn without_clearing_recipient_events ( mut self ) -> Self {
@@ -2546,13 +2547,17 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
25462547 self . expected_preimage = Some ( payment_preimage) ;
25472548 self
25482549 }
2550+ pub fn with_custom_tlvs ( mut self , custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ) -> Self {
2551+ self . custom_tlvs = custom_tlvs;
2552+ self
2553+ }
25492554}
25502555
25512556pub fn do_pass_along_path < ' a , ' b , ' c > ( args : PassAlongPathArgs ) -> Option < Event > {
25522557 let PassAlongPathArgs {
25532558 origin_node, expected_path, recv_value, payment_hash : our_payment_hash,
25542559 payment_secret : our_payment_secret, event : ev, payment_claimable_expected,
2555- clear_recipient_events, expected_preimage, is_probe
2560+ clear_recipient_events, expected_preimage, is_probe, custom_tlvs
25562561 } = args;
25572562
25582563 let mut payment_event = SendEvent :: from_event ( ev) ;
@@ -2585,6 +2590,7 @@ pub fn do_pass_along_path<'a, 'b, 'c>(args: PassAlongPathArgs) -> Option<Event>
25852590 assert_eq ! ( our_payment_hash, * payment_hash) ;
25862591 assert_eq ! ( node. node. get_our_node_id( ) , receiver_node_id. unwrap( ) ) ;
25872592 assert ! ( onion_fields. is_some( ) ) ;
2593+ assert_eq ! ( onion_fields. as_ref( ) . unwrap( ) . custom_tlvs, custom_tlvs) ;
25882594 match & purpose {
25892595 PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
25902596 assert_eq ! ( expected_preimage, * payment_preimage) ;
0 commit comments