@@ -21,15 +21,16 @@ use crate::ln::msgs::ChannelMessageHandler;
2121use  crate :: ln:: onion_utils; 
2222use  crate :: ln:: onion_utils:: INVALID_ONION_BLINDING ; 
2323use  crate :: ln:: outbound_payment:: Retry ; 
24+ use  crate :: offers:: invoice:: BlindedPayInfo ; 
2425use  crate :: prelude:: * ; 
2526use  crate :: routing:: router:: { Payee ,  PaymentParameters ,  RouteParameters } ; 
2627use  crate :: util:: config:: UserConfig ; 
2728use  crate :: util:: test_utils; 
2829
29- pub   fn  get_blinded_route_parameters ( 
30- 	amt_msat :   u64 ,   payment_secret :  PaymentSecret ,  node_ids :  Vec < PublicKey > , 
30+ fn  blinded_payment_path ( 
31+ 	payment_secret :  PaymentSecret ,  node_ids :  Vec < PublicKey > , 
3132	channel_upds :  & [ & msgs:: UnsignedChannelUpdate ] ,  keys_manager :  & test_utils:: TestKeysInterface 
32- )  -> RouteParameters  { 
33+ )  -> ( BlindedPayInfo ,   BlindedPath )  { 
3334	let  mut  intermediate_nodes = Vec :: new ( ) ; 
3435	for  ( node_id,  chan_upd)  in  node_ids. iter ( ) . zip ( channel_upds)  { 
3536		intermediate_nodes. push ( ForwardNode  { 
@@ -58,13 +59,20 @@ pub fn get_blinded_route_parameters(
5859		} , 
5960	} ; 
6061	let  mut  secp_ctx = Secp256k1 :: new ( ) ; 
61- 	let  blinded_path =  BlindedPath :: new_for_payment ( 
62+ 	BlindedPath :: new_for_payment ( 
6263		& intermediate_nodes[ ..] ,  * node_ids. last ( ) . unwrap ( ) ,  payee_tlvs, 
6364		channel_upds. last ( ) . unwrap ( ) . htlc_maximum_msat ,  keys_manager,  & secp_ctx
64- 	) . unwrap ( ) ; 
65+ 	) . unwrap ( ) 
66+ } 
6567
68+ pub  fn  get_blinded_route_parameters ( 
69+ 	amt_msat :  u64 ,  payment_secret :  PaymentSecret ,  node_ids :  Vec < PublicKey > , 
70+ 	channel_upds :  & [ & msgs:: UnsignedChannelUpdate ] ,  keys_manager :  & test_utils:: TestKeysInterface 
71+ )  -> RouteParameters  { 
6672	RouteParameters :: from_payment_params_and_value ( 
67- 		PaymentParameters :: blinded ( vec ! [ blinded_path] ) ,  amt_msat
73+ 		PaymentParameters :: blinded ( vec ! [ 
74+ 			blinded_payment_path( payment_secret,  node_ids,  channel_upds,  keys_manager) 
75+ 		] ) ,  amt_msat
6876	) 
6977} 
7078
0 commit comments