File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -569,7 +569,12 @@ fn filter_channels<L: Deref>(
569
569
match filtered_channels. entry ( channel. counterparty . node_id ) {
570
570
hash_map:: Entry :: Occupied ( mut entry) => {
571
571
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.
572
574
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.
573
578
let new_higher_capacity = channel. is_public == entry. get ( ) . is_public &&
574
579
channel. inbound_capacity_msat > current_max_capacity;
575
580
if new_now_public || new_higher_capacity {
You can’t perform that action at this time.
0 commit comments