@@ -2507,6 +2507,7 @@ pub struct PassAlongPathArgs<'a, 'b, 'c, 'd> {
2507
2507
pub clear_recipient_events : bool ,
2508
2508
pub expected_preimage : Option < PaymentPreimage > ,
2509
2509
pub is_probe : bool ,
2510
+ pub custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
2510
2511
}
2511
2512
2512
2513
impl < ' a , ' b , ' c , ' d > PassAlongPathArgs < ' a , ' b , ' c , ' d > {
@@ -2517,7 +2518,7 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
2517
2518
Self {
2518
2519
origin_node, expected_path, recv_value, payment_hash, payment_secret : None , event,
2519
2520
payment_claimable_expected : true , clear_recipient_events : true , expected_preimage : None ,
2520
- is_probe : false ,
2521
+ is_probe : false , custom_tlvs : Vec :: new ( ) ,
2521
2522
}
2522
2523
}
2523
2524
pub fn without_clearing_recipient_events ( mut self ) -> Self {
@@ -2541,13 +2542,17 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
2541
2542
self . expected_preimage = Some ( payment_preimage) ;
2542
2543
self
2543
2544
}
2545
+ pub fn with_custom_tlvs ( mut self , custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ) -> Self {
2546
+ self . custom_tlvs = custom_tlvs;
2547
+ self
2548
+ }
2544
2549
}
2545
2550
2546
2551
pub fn do_pass_along_path < ' a , ' b , ' c > ( args : PassAlongPathArgs ) -> Option < Event > {
2547
2552
let PassAlongPathArgs {
2548
2553
origin_node, expected_path, recv_value, payment_hash : our_payment_hash,
2549
2554
payment_secret : our_payment_secret, event : ev, payment_claimable_expected,
2550
- clear_recipient_events, expected_preimage, is_probe
2555
+ clear_recipient_events, expected_preimage, is_probe, custom_tlvs
2551
2556
} = args;
2552
2557
2553
2558
let mut payment_event = SendEvent :: from_event ( ev) ;
@@ -2580,6 +2585,7 @@ pub fn do_pass_along_path<'a, 'b, 'c>(args: PassAlongPathArgs) -> Option<Event>
2580
2585
assert_eq ! ( our_payment_hash, * payment_hash) ;
2581
2586
assert_eq ! ( node. node. get_our_node_id( ) , receiver_node_id. unwrap( ) ) ;
2582
2587
assert ! ( onion_fields. is_some( ) ) ;
2588
+ assert_eq ! ( onion_fields. as_ref( ) . unwrap( ) . custom_tlvs, custom_tlvs) ;
2583
2589
match & purpose {
2584
2590
PaymentPurpose :: InvoicePayment { payment_preimage, payment_secret, .. } => {
2585
2591
assert_eq ! ( expected_preimage, * payment_preimage) ;
0 commit comments