@@ -133,6 +133,8 @@ where
133133 )
134134}
135135
136+ const MAX_CHANNEL_HINTS : usize = 3 ;
137+
136138fn _create_phantom_invoice < ES : Deref , NS : Deref , L : Deref > (
137139 amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , description : InvoiceDescription ,
138140 invoice_expiry_delta_secs : u32 , phantom_route_hints : Vec < PhantomRouteHints > , entropy_source : ES ,
@@ -203,9 +205,8 @@ where
203205 invoice = invoice. amount_milli_satoshis ( amt) ;
204206 }
205207
206- const MAX_HINTS : usize = 3 ;
207208
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 ) {
209210 invoice = invoice. private_route ( route_hint) ;
210211 }
211212
@@ -641,7 +642,7 @@ where
641642 // look at the public channels instead.
642643 log_trace ! ( logger, "Not including channels in invoice route hints on account of public channel {}" ,
643644 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) ;
645646 }
646647 }
647648
@@ -751,7 +752,7 @@ where
751752 b. inbound_capacity_msat . cmp ( & a. inbound_capacity_msat )
752753 } } ) ;
753754
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)
755756}
756757
757758/// prefer_current_channel chooses a channel to use for route hints between a currently selected and candidate
0 commit comments