@@ -2512,6 +2512,7 @@ pub struct PassAlongPathArgs<'a, 'b, 'c, 'd> {
2512
2512
pub clear_recipient_events : bool ,
2513
2513
pub expected_preimage : Option < PaymentPreimage > ,
2514
2514
pub is_probe : bool ,
2515
+ pub custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
2515
2516
}
2516
2517
2517
2518
impl < ' a , ' b , ' c , ' d > PassAlongPathArgs < ' a , ' b , ' c , ' d > {
@@ -2522,7 +2523,7 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
2522
2523
Self {
2523
2524
origin_node, expected_path, recv_value, payment_hash, payment_secret : None , event,
2524
2525
payment_claimable_expected : true , clear_recipient_events : true , expected_preimage : None ,
2525
- is_probe : false ,
2526
+ is_probe : false , custom_tlvs : Vec :: new ( ) ,
2526
2527
}
2527
2528
}
2528
2529
pub fn without_clearing_recipient_events ( mut self ) -> Self {
@@ -2546,13 +2547,17 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
2546
2547
self . expected_preimage = Some ( payment_preimage) ;
2547
2548
self
2548
2549
}
2550
+ pub fn with_custom_tlvs ( mut self , custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ) -> Self {
2551
+ self . custom_tlvs = custom_tlvs;
2552
+ self
2553
+ }
2549
2554
}
2550
2555
2551
2556
pub fn do_pass_along_path < ' a , ' b , ' c > ( args : PassAlongPathArgs ) -> Option < Event > {
2552
2557
let PassAlongPathArgs {
2553
2558
origin_node, expected_path, recv_value, payment_hash : our_payment_hash,
2554
2559
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
2556
2561
} = args;
2557
2562
2558
2563
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>
2585
2590
assert_eq ! ( our_payment_hash, * payment_hash) ;
2586
2591
assert_eq ! ( node. node. get_our_node_id( ) , receiver_node_id. unwrap( ) ) ;
2587
2592
assert ! ( onion_fields. is_some( ) ) ;
2593
+ assert_eq ! ( onion_fields. as_ref( ) . unwrap( ) . custom_tlvs, custom_tlvs) ;
2588
2594
match & purpose {
2589
2595
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
2590
2596
assert_eq ! ( expected_preimage, * payment_preimage) ;
0 commit comments