@@ -338,7 +338,7 @@ pub(crate) fn set_max_path_length(
338
338
core:: cmp:: max (
339
339
route_params. final_value_msat . saturating_mul ( OVERPAY_ESTIMATE_MULTIPLER ) ,
340
340
MIN_FINAL_VALUE_ESTIMATE_WITH_OVERPAY ,
341
- )
341
+ ) ,
342
342
) ;
343
343
344
344
let blinded_tail_opt = route_params
@@ -354,13 +354,15 @@ pub(crate) fn set_max_path_length(
354
354
excess_final_cltv_expiry_delta : 0 ,
355
355
} ) ;
356
356
357
+ let cltv_expiry_delta =
358
+ core:: cmp:: min ( route_params. payment_params . max_total_cltv_expiry_delta , 0x1000_0000 ) ;
357
359
let unblinded_route_hop = RouteHop {
358
360
pubkey : PublicKey :: from_slice ( & [ 2 ; 33 ] ) . unwrap ( ) ,
359
361
node_features : NodeFeatures :: empty ( ) ,
360
362
short_channel_id : 42 ,
361
363
channel_features : ChannelFeatures :: empty ( ) ,
362
364
fee_msat : final_value_msat_with_overpay_buffer,
363
- cltv_expiry_delta : core :: cmp :: min ( route_params . payment_params . max_total_cltv_expiry_delta , 0x1000_0000 ) ,
365
+ cltv_expiry_delta,
364
366
maybe_announced_channel : false ,
365
367
} ;
366
368
let mut num_reserved_bytes: usize = 0 ;
@@ -1283,7 +1285,7 @@ fn decode_next_hop<T, R: ReadableArgs<T>, N: NextPacketBytes>(
1283
1285
mod tests {
1284
1286
use crate :: io;
1285
1287
use crate :: ln:: msgs;
1286
- use crate :: routing:: router:: { PaymentParameters , Path , Route , RouteHop } ;
1288
+ use crate :: routing:: router:: { Path , PaymentParameters , Route , RouteHop } ;
1287
1289
use crate :: types:: features:: { ChannelFeatures , NodeFeatures } ;
1288
1290
use crate :: types:: payment:: PaymentHash ;
1289
1291
use crate :: util:: ser:: { VecWriter , Writeable , Writer } ;
0 commit comments