Skip to content

Commit bc1fac3

Browse files
committed
Skip node ann. broadcast if the public channel isn't ready yet
Previously, we'd only skip broadcasting a node announcement if we don't have public channel. However, this could lead to us broadcasting the initial node announcement too early: it would be broadcast after the channel is pending but before it's confirmed and we had a chance to generate and exchange the channel announcement, leading to our counterparty ignoring the node announcement. Here, we just check that the public channel is actually ready (but don't bother if it's useable) before we trigger the broadcast. Note that this wouldn't have been a big issue before as we expect announced nodes to be always-online and we'd have rebroadcast the announcement after an hour anyways. However, it can be annoying in testing.
1 parent 0e02969 commit bc1fac3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ impl Node {
580580
continue;
581581
}
582582

583-
if !bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
584-
// Skip if we don't have any public channels.
583+
if !bcast_cm.list_channels().iter().any(|chan| chan.is_public && chan.is_channel_ready) {
584+
// Skip if we don't have any public channels that are ready.
585585
continue;
586586
}
587587

0 commit comments

Comments
 (0)