diff options
Diffstat (limited to 'src/swarm')
| -rw-r--r-- | src/swarm/bootstrap.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/swarm/bootstrap.rs b/src/swarm/bootstrap.rs index ad1de61..7c4c444 100644 --- a/src/swarm/bootstrap.rs +++ b/src/swarm/bootstrap.rs @@ -124,6 +124,17 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String], start: Start) } let now = Instant::now(); + // Nodes the transport found by itself (libp2p on the LAN): seeds too. + let found = state.transport.discovered_seeds(); + if !found.is_empty() { + for seed in found { + if !unresolved.contains(&seed) { + info!(seed = %seed, "Found a node nearby; joining through it"); + unresolved.push(seed); + } + } + next_resolve = now; + } if !unresolved.is_empty() && now >= next_resolve { resolve_seeds(state, &mut unresolved, &mut failing).await; if !unresolved.is_empty() { |
