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 | b1fe3a194a066fadcd11868c19a7d1e49e069446 (patch) | |
| tree | 46c64a07ed185d434c2984f7e2ec948634d9bdf8 /src/swarm/bootstrap.rs | |
| parent | fb1a379ccba6d943edc827a17151cdd1302600e7 (diff) | |
use libp2p mDNS
Diffstat (limited to 'src/swarm/bootstrap.rs')
| -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() { |
