Skip to content

Commit 15d862d

Browse files
committed
f Check again after interval tick
1 parent 8f5a430 commit 15d862d

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/lib.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -794,18 +794,24 @@ impl Node {
794794
return;
795795
}
796796

797-
if bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
798-
interval.tick().await;
797+
if !bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
798+
continue;
799+
}
799800

800-
while bcast_pm.get_peer_node_ids().is_empty() {
801-
// Sleep a bit and retry if we don't have any peers yet.
802-
tokio::time::sleep(Duration::from_secs(5)).await;
803-
}
801+
interval.tick().await;
804802

805-
let addresses =
806-
bcast_config.listening_address.iter().cloned().map(|a| a.0).collect();
807-
bcast_pm.broadcast_node_announcement([0; 3], [0; 32], addresses);
803+
if !bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
804+
continue;
808805
}
806+
807+
while bcast_pm.get_peer_node_ids().is_empty() {
808+
// Sleep a bit and retry if we don't have any peers yet.
809+
tokio::time::sleep(Duration::from_secs(5)).await;
810+
}
811+
812+
let addresses =
813+
bcast_config.listening_address.iter().cloned().map(|a| a.0).collect();
814+
bcast_pm.broadcast_node_announcement([0; 3], [0; 32], addresses);
809815
}
810816
});
811817

0 commit comments

Comments
 (0)