@@ -89,7 +89,7 @@ fn large_payment_metadata() {
89
89
// next-hop peer given the payment_metadata size.
90
90
let ( mut route_0_2, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( & nodes[ 0 ] , & nodes[ 2 ] , amt_msat) ;
91
91
let mut route_params_0_2 = route_0_2. route_params . clone ( ) . unwrap ( ) ;
92
- route_params_0_2. payment_params . max_intermediate_hops = 0 ;
92
+ route_params_0_2. payment_params . max_path_length = 1 ;
93
93
nodes[ 0 ] . router . expect_find_route_query ( route_params_0_2) ;
94
94
let err = nodes[ 0 ] . node . send_payment ( payment_hash_2, recipient_onion_max_md_size. clone ( ) , PaymentId ( payment_hash_2. 0 ) , route_0_2. route_params . clone ( ) . unwrap ( ) , Retry :: Attempts ( 0 ) ) . unwrap_err ( ) ;
95
95
assert_eq ! ( err, RetryableSendFailure :: RouteNotFound ) ;
@@ -111,15 +111,15 @@ fn large_payment_metadata() {
111
111
_ => panic ! ( ) ,
112
112
}
113
113
114
- // If we remove enough payment_metadata bytes to allow for 1 intermediate hop , we're now able to
115
- // send to nodes[2].
114
+ // If we remove enough payment_metadata bytes to allow for 2 hops , we're now able to send to
115
+ // nodes[2].
116
116
let mut recipient_onion_allws_2_hops = RecipientOnionFields {
117
117
payment_secret : Some ( payment_secret_2) ,
118
118
payment_metadata : Some ( vec ! [ 42 ; max_metadata_len - INTERMED_PAYLOAD_LEN_ESTIMATE ] ) ,
119
119
custom_tlvs : Vec :: new ( ) ,
120
120
} ;
121
121
let mut route_params_0_2 = route_0_2. route_params . clone ( ) . unwrap ( ) ;
122
- route_params_0_2. payment_params . max_intermediate_hops = 1 ;
122
+ route_params_0_2. payment_params . max_path_length = 2 ;
123
123
nodes[ 0 ] . router . expect_find_route_query ( route_params_0_2) ;
124
124
nodes[ 0 ] . node . send_payment ( payment_hash_2, recipient_onion_allws_2_hops. clone ( ) , PaymentId ( payment_hash_2. 0 ) , route_0_2. route_params . unwrap ( ) , Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
125
125
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -184,7 +184,7 @@ fn one_hop_blinded_path_with_custom_tlv() {
184
184
- PAYLOAD_HMAC_LEN
185
185
- final_payload_len_without_custom_tlv;
186
186
187
- // Check that we can send the maximum custom TLV with 0 unblinded intermediate hops .
187
+ // Check that we can send the maximum custom TLV with 1 blinded hop .
188
188
let recipient_onion_max_custom_tlv_size = RecipientOnionFields :: spontaneous_empty ( )
189
189
. with_custom_tlvs ( vec ! [ ( CUSTOM_TLV_TYPE , vec![ 42 ; max_custom_tlv_len] ) ] )
190
190
. unwrap ( ) ;
@@ -211,8 +211,8 @@ fn one_hop_blinded_path_with_custom_tlv() {
211
211
let err = nodes[ 0 ] . node . send_payment ( payment_hash, recipient_onion_max_custom_tlv_size. clone ( ) , PaymentId ( payment_hash. 0 ) , route_params. clone ( ) , Retry :: Attempts ( 0 ) ) . unwrap_err ( ) ;
212
212
assert_eq ! ( err, RetryableSendFailure :: RouteNotFound ) ;
213
213
214
- // If we remove enough custom TLV bytes to allow for 1 intermediate hop, we're now able to send
215
- // nodes[0] -> nodes[2].
214
+ // If we remove enough custom TLV bytes to allow for 1 intermediate unblinded hop, we're now able
215
+ // to send nodes[0] -> nodes[2].
216
216
let mut recipient_onion_allows_2_hops = recipient_onion_max_custom_tlv_size. clone ( ) ;
217
217
recipient_onion_allows_2_hops. custom_tlvs [ 0 ] . 1 . resize ( max_custom_tlv_len - INTERMED_PAYLOAD_LEN_ESTIMATE , 0 ) ;
218
218
nodes[ 0 ] . node . send_payment ( payment_hash, recipient_onion_allows_2_hops. clone ( ) , PaymentId ( payment_hash. 0 ) , route_params. clone ( ) , Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
@@ -302,8 +302,8 @@ fn blinded_path_with_custom_tlv() {
302
302
let err = nodes[ 0 ] . node . send_payment ( payment_hash, recipient_onion_max_custom_tlv_size. clone ( ) , PaymentId ( payment_hash. 0 ) , route_params. clone ( ) , Retry :: Attempts ( 0 ) ) . unwrap_err ( ) ;
303
303
assert_eq ! ( err, RetryableSendFailure :: RouteNotFound ) ;
304
304
305
- // If we remove enough custom TLV bytes to allow for 1 intermediate hop, we're now able to send
306
- // nodes[0] -> nodes[3].
305
+ // If we remove enough custom TLV bytes to allow for 1 intermediate unblinded hop, we're now able
306
+ // to send nodes[0] -> nodes[3].
307
307
let mut recipient_onion_allows_2_hops = recipient_onion_max_custom_tlv_size. clone ( ) ;
308
308
recipient_onion_allows_2_hops. custom_tlvs [ 0 ] . 1 . resize ( max_custom_tlv_len - INTERMED_PAYLOAD_LEN_ESTIMATE , 0 ) ;
309
309
nodes[ 0 ] . node . send_payment ( payment_hash, recipient_onion_allows_2_hops. clone ( ) , PaymentId ( payment_hash. 0 ) , route_params. clone ( ) , Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
0 commit comments