Skip to content

Commit f2314dc

Browse files
committed
f add more comment
1 parent aa9cd4d commit f2314dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning-invoice/src/utils.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,12 @@ fn filter_channels<L: Deref>(
569569
match filtered_channels.entry(channel.counterparty.node_id) {
570570
hash_map::Entry::Occupied(mut entry) => {
571571
let current_max_capacity = entry.get().inbound_capacity_msat;
572+
// If this channel is public and the previous channel is not, ensure we replace the
573+
// previous channel to avoid announcing non-public channels.
572574
let new_now_public = channel.is_public && !entry.get().is_public;
575+
// If the public-ness of the channel has not changed (in which case simply defer to
576+
// `new_now_public), and this channel has a greater capacity, prefer to announce
577+
// this channel.
573578
let new_higher_capacity = channel.is_public == entry.get().is_public &&
574579
channel.inbound_capacity_msat > current_max_capacity;
575580
if new_now_public || new_higher_capacity {

0 commit comments

Comments
 (0)