@@ -2535,6 +2535,7 @@ pub struct PassAlongPathArgs<'a, 'b, 'c, 'd> {
2535
2535
pub expected_preimage : Option < PaymentPreimage > ,
2536
2536
pub is_probe : bool ,
2537
2537
pub custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
2538
+ pub payment_metadata : Option < Vec < u8 > > ,
2538
2539
}
2539
2540
2540
2541
impl < ' a , ' b , ' c , ' d > PassAlongPathArgs < ' a , ' b , ' c , ' d > {
@@ -2545,7 +2546,7 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
2545
2546
Self {
2546
2547
origin_node, expected_path, recv_value, payment_hash, payment_secret : None , event,
2547
2548
payment_claimable_expected : true , clear_recipient_events : true , expected_preimage : None ,
2548
- is_probe : false , custom_tlvs : Vec :: new ( ) ,
2549
+ is_probe : false , custom_tlvs : Vec :: new ( ) , payment_metadata : None ,
2549
2550
}
2550
2551
}
2551
2552
pub fn without_clearing_recipient_events ( mut self ) -> Self {
@@ -2573,13 +2574,17 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
2573
2574
self . custom_tlvs = custom_tlvs;
2574
2575
self
2575
2576
}
2577
+ pub fn with_payment_metadata ( mut self , payment_metadata : Vec < u8 > ) -> Self {
2578
+ self . payment_metadata = Some ( payment_metadata) ;
2579
+ self
2580
+ }
2576
2581
}
2577
2582
2578
2583
pub fn do_pass_along_path < ' a , ' b , ' c > ( args : PassAlongPathArgs ) -> Option < Event > {
2579
2584
let PassAlongPathArgs {
2580
2585
origin_node, expected_path, recv_value, payment_hash : our_payment_hash,
2581
2586
payment_secret : our_payment_secret, event : ev, payment_claimable_expected,
2582
- clear_recipient_events, expected_preimage, is_probe, custom_tlvs
2587
+ clear_recipient_events, expected_preimage, is_probe, custom_tlvs, payment_metadata ,
2583
2588
} = args;
2584
2589
2585
2590
let mut payment_event = SendEvent :: from_event ( ev) ;
@@ -2613,6 +2618,7 @@ pub fn do_pass_along_path<'a, 'b, 'c>(args: PassAlongPathArgs) -> Option<Event>
2613
2618
assert_eq ! ( node. node. get_our_node_id( ) , receiver_node_id. unwrap( ) ) ;
2614
2619
assert ! ( onion_fields. is_some( ) ) ;
2615
2620
assert_eq ! ( onion_fields. as_ref( ) . unwrap( ) . custom_tlvs, custom_tlvs) ;
2621
+ assert_eq ! ( onion_fields. as_ref( ) . unwrap( ) . payment_metadata, payment_metadata) ;
2616
2622
match & purpose {
2617
2623
PaymentPurpose :: Bolt11InvoicePayment { payment_preimage, payment_secret, .. } => {
2618
2624
assert_eq ! ( expected_preimage, * payment_preimage) ;
0 commit comments