@@ -133,6 +133,8 @@ where
133
133
)
134
134
}
135
135
136
+ const MAX_CHANNEL_HINTS : usize = 3 ;
137
+
136
138
fn _create_phantom_invoice < ES : Deref , NS : Deref , L : Deref > (
137
139
amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , description : InvoiceDescription ,
138
140
invoice_expiry_delta_secs : u32 , phantom_route_hints : Vec < PhantomRouteHints > , entropy_source : ES ,
@@ -203,9 +205,8 @@ where
203
205
invoice = invoice. amount_milli_satoshis ( amt) ;
204
206
}
205
207
206
- const MAX_HINTS : usize = 3 ;
207
208
208
- for route_hint in select_phantom_hints ( amt_msat, phantom_route_hints, logger) . take ( MAX_HINTS ) {
209
+ for route_hint in select_phantom_hints ( amt_msat, phantom_route_hints, logger) . take ( MAX_CHANNEL_HINTS ) {
209
210
invoice = invoice. private_route ( route_hint) ;
210
211
}
211
212
@@ -641,7 +642,7 @@ where
641
642
// look at the public channels instead.
642
643
log_trace ! ( logger, "Not including channels in invoice route hints on account of public channel {}" ,
643
644
log_bytes!( channel. channel_id) ) ;
644
- return vec ! [ ] . into_iter ( ) . take ( 3 ) . map ( route_hint_from_channel) ;
645
+ return vec ! [ ] . into_iter ( ) . take ( MAX_CHANNEL_HINTS ) . map ( route_hint_from_channel) ;
645
646
}
646
647
}
647
648
@@ -751,7 +752,7 @@ where
751
752
b. inbound_capacity_msat . cmp ( & a. inbound_capacity_msat )
752
753
} } ) ;
753
754
754
- eligible_channels. into_iter ( ) . take ( 3 ) . map ( route_hint_from_channel)
755
+ eligible_channels. into_iter ( ) . take ( MAX_CHANNEL_HINTS ) . map ( route_hint_from_channel)
755
756
}
756
757
757
758
/// prefer_current_channel chooses a channel to use for route hints between a currently selected and candidate
0 commit comments