From 573bf37fbb9d3e650679115e5879b76ae79c3237 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 18 Dec 2022 17:36:33 -0800 Subject: [PATCH] use bootstrap relays in account creation --- damus/Nostr/NostrEvent.swift | 5 ++++- damus/Views/SaveKeysView.swift | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/damus/Nostr/NostrEvent.swift b/damus/Nostr/NostrEvent.swift index 3aa8008..fe7ce89 100644 --- a/damus/Nostr/NostrEvent.swift +++ b/damus/Nostr/NostrEvent.swift @@ -485,7 +485,10 @@ func make_first_contact_event(keypair: Keypair) -> NostrEvent? { } let rw_relay_info = RelayInfo(read: true, write: true) - let relays: [String: RelayInfo] = ["wss://relay.damus.io": rw_relay_info] + var relays: [String: RelayInfo] = [:] + for relay in BOOTSTRAP_RELAYS { + relays[relay] = rw_relay_info + } let relay_json = encode_json(relays)! let damus_pubkey = "3efdaebb1d8923ebd99c9e7ace3b4194ab45512e2be79c1b7d68d9243e0d2681" let tags = [ diff --git a/damus/Views/SaveKeysView.swift b/damus/Views/SaveKeysView.swift index 61ad197..70d26c0 100644 --- a/damus/Views/SaveKeysView.swift +++ b/damus/Views/SaveKeysView.swift @@ -80,7 +80,10 @@ struct SaveKeysView: View { } func complete_account_creation(_ account: CreateAccountModel) { - add_rw_relay(self.pool, "wss://relay.damus.io") + for relay in BOOTSTRAP_RELAYS { + add_rw_relay(self.pool, relay) + } + self.pool.register_handler(sub_id: "signup", handler: handle_event) self.loading = true