Skip to content

Commit 385b422

Browse files
committed
f Check again after interval tick
1 parent 9b26229 commit 385b422

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
@@ -898,18 +898,24 @@ impl Node {
898898
return;
899899
}
900900

901-
if bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
902-
interval.tick().await;
901+
if !bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
902+
continue;
903+
}
903904

904-
while bcast_pm.get_peer_node_ids().is_empty() {
905-
// Sleep a bit and retry if we don't have any peers yet.
906-
tokio::time::sleep(Duration::from_secs(5)).await;
907-
}
905+
interval.tick().await;
908906

909-
let addresses =
910-
bcast_config.listening_address.iter().cloned().map(|a| a.0).collect();
911-
bcast_pm.broadcast_node_announcement([0; 3], [0; 32], addresses);
907+
if !bcast_cm.list_channels().iter().any(|chan| chan.is_public) {
908+
continue;
912909
}
910+
911+
while bcast_pm.get_peer_node_ids().is_empty() {
912+
// Sleep a bit and retry if we don't have any peers yet.
913+
tokio::time::sleep(Duration::from_secs(5)).await;
914+
}
915+
916+
let addresses =
917+
bcast_config.listening_address.iter().cloned().map(|a| a.0).collect();
918+
bcast_pm.broadcast_node_announcement([0; 3], [0; 32], addresses);
913919
}
914920
});
915921

0 commit comments

Comments
 (0)