File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -588,6 +588,7 @@ fn get_invoice(
588
588
589
589
// Add route hints to the invoice.
590
590
let our_channels = channel_manager. list_usable_channels ( ) ;
591
+ let mut min_final_cltv_expiry = 9 ;
591
592
for channel in our_channels {
592
593
let short_channel_id = match channel. short_channel_id {
593
594
Some ( id) => id. to_be_bytes ( ) ,
@@ -597,6 +598,9 @@ fn get_invoice(
597
598
Some ( info) => info,
598
599
None => continue ,
599
600
} ;
601
+ if forwarding_info. cltv_expiry_delta > min_final_cltv_expiry {
602
+ min_final_cltv_expiry = forwarding_info. cltv_expiry_delta ;
603
+ }
600
604
invoice = invoice. route ( vec ! [ lightning_invoice:: RouteHop {
601
605
pubkey: channel. remote_network_id,
602
606
short_channel_id,
@@ -605,6 +609,7 @@ fn get_invoice(
605
609
cltv_expiry_delta: forwarding_info. cltv_expiry_delta,
606
610
} ] ) ;
607
611
}
612
+ invoice = invoice. min_final_cltv_expiry ( min_final_cltv_expiry. into ( ) ) ;
608
613
609
614
// Sign the invoice.
610
615
let invoice =
You can’t perform that action at this time.
0 commit comments