Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
cli/sync: filter seeds without an address
Merged fintohaps opened 5 months ago

If a seed for syncing does not have an address, the local node will not be able to connect to it.

These can be filtered out so that no connection attempts are made for these nodes.

1 file changed +7 -1 0ec084fc 28c8c153
modified crates/radicle-cli/src/commands/sync.rs
@@ -281,7 +281,13 @@ pub fn fetch(
            let candidates = connected
                .into_iter()
                .map(|seed| seed.nid)
-
                .chain(disconnected.into_iter().map(|seed| seed.nid))
+
                .chain(disconnected.into_iter().filter_map(|seed| {
+
                    if seed.addrs.is_empty() {
+
                        None
+
                    } else {
+
                        Some(seed.nid)
+
                    }
+
                }))
                .map(sync::fetch::Candidate::new);
            sync::FetcherConfig::public(settings.seeds.clone(), settings.replicas, *local)
                .with_candidates(candidates)