@@ -599,6 +599,20 @@ where
599
599
let mut online_min_capacity_channel_exists = false ;
600
600
let mut has_pub_unconf_chan = false ;
601
601
602
+ let route_hint_from_channel = |channel : ChannelDetails | {
603
+ let forwarding_info = channel. counterparty . forwarding_info . as_ref ( ) . unwrap ( ) ;
604
+ RouteHint ( vec ! [ RouteHintHop {
605
+ src_node_id: channel. counterparty. node_id,
606
+ short_channel_id: channel. get_inbound_payment_scid( ) . unwrap( ) ,
607
+ fees: RoutingFees {
608
+ base_msat: forwarding_info. fee_base_msat,
609
+ proportional_millionths: forwarding_info. fee_proportional_millionths,
610
+ } ,
611
+ cltv_expiry_delta: forwarding_info. cltv_expiry_delta,
612
+ htlc_minimum_msat: channel. inbound_htlc_minimum_msat,
613
+ htlc_maximum_msat: channel. inbound_htlc_maximum_msat, } ] )
614
+ } ;
615
+
602
616
log_trace ! ( logger, "Considering {} channels for invoice route hints" , channels. len( ) ) ;
603
617
for channel in channels. into_iter ( ) . filter ( |chan| chan. is_channel_ready ) {
604
618
if channel. get_inbound_payment_scid ( ) . is_none ( ) || channel. counterparty . forwarding_info . is_none ( ) {
@@ -677,19 +691,6 @@ where
677
691
}
678
692
}
679
693
680
- fn route_hint_from_channel ( channel : ChannelDetails ) -> RouteHint {
681
- let forwarding_info = channel. counterparty . forwarding_info . as_ref ( ) . unwrap ( ) ;
682
- RouteHint ( vec ! [ RouteHintHop {
683
- src_node_id: channel. counterparty. node_id,
684
- short_channel_id: channel. get_inbound_payment_scid( ) . unwrap( ) ,
685
- fees: RoutingFees {
686
- base_msat: forwarding_info. fee_base_msat,
687
- proportional_millionths: forwarding_info. fee_proportional_millionths,
688
- } ,
689
- cltv_expiry_delta: forwarding_info. cltv_expiry_delta,
690
- htlc_minimum_msat: channel. inbound_htlc_minimum_msat,
691
- htlc_maximum_msat: channel. inbound_htlc_maximum_msat, } ] )
692
- } ;
693
694
// If all channels are private, prefer to return route hints which have a higher capacity than
694
695
// the payment value and where we're currently connected to the channel counterparty.
695
696
// Even if we cannot satisfy both goals, always ensure we include *some* hints, preferring
0 commit comments