@@ -333,23 +333,19 @@ pub(crate) fn set_max_path_length(
333
333
MIN_FINAL_VALUE_ESTIMATE_WITH_OVERPAY ,
334
334
) ;
335
335
336
- let ( num_reserved_hops , blinded_tail_opt) = route_params
336
+ let blinded_tail_opt = route_params
337
337
. payment_params
338
338
. payee
339
339
. blinded_route_hints ( )
340
340
. iter ( )
341
341
. map ( |( _, path) | path)
342
342
. max_by_key ( |path| path. serialized_length ( ) )
343
- . map ( |largest_path| {
344
- let blinded_tail = BlindedTailHopIter {
345
- hops : largest_path. blinded_hops . iter ( ) ,
346
- blinding_point : largest_path. blinding_point ,
347
- final_value_msat : final_value_msat_with_overpay_buffer,
348
- excess_final_cltv_expiry_delta : 0 ,
349
- } ;
350
- ( largest_path. blinded_hops . len ( ) , Some ( blinded_tail) )
351
- } )
352
- . unwrap_or ( ( 1 , None ) ) ;
343
+ . map ( |largest_path| BlindedTailHopIter {
344
+ hops : largest_path. blinded_hops . iter ( ) ,
345
+ blinding_point : largest_path. blinding_point ,
346
+ final_value_msat : final_value_msat_with_overpay_buffer,
347
+ excess_final_cltv_expiry_delta : 0 ,
348
+ } ) ;
353
349
354
350
let unblinded_route_hop = RouteHop {
355
351
pubkey : PublicKey :: from_slice ( & [ 2 ; 33 ] ) . unwrap ( ) ,
@@ -379,7 +375,7 @@ pub(crate) fn set_max_path_length(
379
375
let max_path_length = 1300usize
380
376
. checked_sub ( num_reserved_bytes)
381
377
. map ( |p| p / unblinded_intermed_payload_len)
382
- . and_then ( |l| u8:: try_from ( l. saturating_add ( num_reserved_hops ) ) . ok ( ) )
378
+ . and_then ( |l| u8:: try_from ( l. saturating_add ( 1 ) ) . ok ( ) )
383
379
. ok_or ( ( ) ) ?;
384
380
385
381
route_params. payment_params . max_path_length =
0 commit comments