diff options
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. |
