Skip to content

Commit f8d941b

Browse files
committed
f simplify comment - the if tree is readable anyway
1 parent 85b0ac4 commit f8d941b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning-invoice/src/utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,10 @@ fn filter_channels(channels: Vec<ChannelDetails>, min_inbound_capacity_msat: Opt
435435
htlc_minimum_msat: channel.inbound_htlc_minimum_msat,
436436
htlc_maximum_msat: channel.inbound_htlc_maximum_msat,}])
437437
};
438-
// If all channels are private, return the route hint for the highest inbound capacity channel
439-
// per counterparty node. If channels with an higher inbound capacity than the
440-
// min_inbound_capacity exists, filter out the channels with a lower capacity than that.
441-
// Further, if we are connected to our peer for any channels, only return those.
438+
// If all channels are private, prefer to return route hints which have a higher capacity than
439+
// the payment value and where we're currently connected to the channel counterparty.
440+
// Even if we cannot satisfy both goals, always ensure we include *some* hints, preferring
441+
// those which meet at least one criteria.
442442
filtered_channels.into_iter()
443443
.filter(|(_counterparty_id, channel)| {
444444
if online_min_capacity_channel_exists {

0 commit comments

Comments
 (0)