diff options
| author | tv <tv@krebsco.de> | 2026-11-06 04:15:59 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-06 04:15:59 +0100 |
| commit | 278ca3cd21397ffad07f0874b80b77f41088a3f2 (patch) | |
| tree | e240d5d0874fba9008544c970ce7d26e22c22c2a /src/swarm/bootstrap.rs | |
| parent | f4db88178bdf3e8f28cd42502d6e0c6905988687 (diff) | |
swarm neighbours
Diffstat (limited to 'src/swarm/bootstrap.rs')
| -rw-r--r-- | src/swarm/bootstrap.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/swarm/bootstrap.rs b/src/swarm/bootstrap.rs index 4f6c072..8665253 100644 --- a/src/swarm/bootstrap.rs +++ b/src/swarm/bootstrap.rs @@ -87,10 +87,18 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String], start: Start) } }; let recorded = JsonValue::String(swarm_id.clone()); + let neighbours = state.neighbours_k; state - .mutate_doc(move |doc| store::write_path(doc, &swarm_id_path(), &recorded)) + .mutate_doc(move |doc| { + store::write_path(doc, &swarm_id_path(), &recorded)?; + store::write_path( + doc, + &crate::swarm::topology::neighbours_path(), + &JsonValue::from(neighbours), + ) + }) .await - .context("Recording the swarm ID")?; + .context("Recording the swarm ID and its neighbours")?; state.initial_sync_done.store(true, Ordering::Release); state.mark_ready(swarm_id).await?; // Remembered members, if any, to find those still running. |
