diff --git a/src/app.rs b/src/app.rs index 31a99061..c1e4b2e0 100644 --- a/src/app.rs +++ b/src/app.rs @@ -675,10 +675,20 @@ impl Damus { "wss://nostr.wine", "wss://purplepag.es", ]; - pool.bootstrapping_relays = bootstrapping_urls.iter().map(|&s| s.to_string()).collect(); - let forced_urls = parsed_args.relays.into_iter().collect::>(); // normally empty - pool.forced_relays = forced_urls; - // the user tracker will call configure_relays after filling in advertised + pool.bootstrapping_relays = bootstrapping_urls + .iter() + .map(|&s| s.to_string()) + .map(|s| RelayPool::canonicalize_url(&s)) + .collect(); + // normally empty + pool.forced_relays = parsed_args + .relays + .into_iter() + .map(|s| RelayPool::canonicalize_url(&s)) + .collect::>(); + // avoid relay thrash, don't call configure_relays here + // because the initial advertised set will be registered + // shortly and it will be called then let account = accounts .get_selected_account() diff --git a/src/task.rs b/src/task.rs index 1b2208c0..9daba441 100644 --- a/src/task.rs +++ b/src/task.rs @@ -103,7 +103,10 @@ fn set_advertised_relays(pool: &mut RelayPool, relays: Vec) { let wakeup = move || { // FIXME - how do we repaint? }; - pool.advertised_relays = relays.into_iter().collect(); + pool.advertised_relays = relays + .into_iter() + .map(|s| RelayPool::canonicalize_url(&s)) + .collect(); if let Err(e) = pool.configure_relays(wakeup) { error!("{:?}", e) }