diff options
| author | tv <tv@krebsco.de> | 2026-10-27 03:44:03 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-27 03:44:03 +0100 |
| commit | c64a96723ec068fa7a9a7b60e6f7edd0f2f8603b (patch) | |
| tree | 6fcf2f9c8f57c071262a62b12f8baaef20801af7 /src/swarm | |
| parent | 16942f707da89e4ce7ce178d116142a17911a614 (diff) | |
use libp2p mDNS
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() { |
