@@ -21,15 +21,16 @@ use crate::ln::msgs::ChannelMessageHandler;
21
21
use crate :: ln:: onion_utils;
22
22
use crate :: ln:: onion_utils:: INVALID_ONION_BLINDING ;
23
23
use crate :: ln:: outbound_payment:: Retry ;
24
+ use crate :: offers:: invoice:: BlindedPayInfo ;
24
25
use crate :: prelude:: * ;
25
26
use crate :: routing:: router:: { Payee , PaymentParameters , RouteParameters } ;
26
27
use crate :: util:: config:: UserConfig ;
27
28
use crate :: util:: test_utils;
28
29
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 > ,
31
32
channel_upds : & [ & msgs:: UnsignedChannelUpdate ] , keys_manager : & test_utils:: TestKeysInterface
32
- ) -> RouteParameters {
33
+ ) -> ( BlindedPayInfo , BlindedPath ) {
33
34
let mut intermediate_nodes = Vec :: new ( ) ;
34
35
for ( node_id, chan_upd) in node_ids. iter ( ) . zip ( channel_upds) {
35
36
intermediate_nodes. push ( ForwardNode {
@@ -58,13 +59,20 @@ pub fn get_blinded_route_parameters(
58
59
} ,
59
60
} ;
60
61
let mut secp_ctx = Secp256k1 :: new ( ) ;
61
- let blinded_path = BlindedPath :: new_for_payment (
62
+ BlindedPath :: new_for_payment (
62
63
& intermediate_nodes[ ..] , * node_ids. last ( ) . unwrap ( ) , payee_tlvs,
63
64
channel_upds. last ( ) . unwrap ( ) . htlc_maximum_msat , keys_manager, & secp_ctx
64
- ) . unwrap ( ) ;
65
+ ) . unwrap ( )
66
+ }
65
67
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 {
66
72
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
68
76
)
69
77
}
70
78
0 commit comments