Get around CCP bootstrap relay banning by caching user's relays as their bootstrap relays
Changelog-Fixed: Get around CCP bootstrap relay banning by caching user's relays as their bootstrap relays
This commit is contained in:
@@ -79,11 +79,15 @@ struct LoginView: View {
|
||||
return
|
||||
}
|
||||
|
||||
// this is a weird way to login anyways
|
||||
/*
|
||||
var bootstrap_relays = load_bootstrap_relays(pubkey: nip05.pubkey)
|
||||
for relay in nip05.relays {
|
||||
if !(BOOTSTRAP_RELAYS.contains { $0 == relay }) {
|
||||
BOOTSTRAP_RELAYS.append(relay)
|
||||
if !(bootstrap_relays.contains { $0 == relay }) {
|
||||
bootstrap_relays.append(relay)
|
||||
}
|
||||
}
|
||||
*/
|
||||
save_pubkey(pubkey: nip05.pubkey)
|
||||
|
||||
notify(.login, ())
|
||||
|
||||
@@ -22,7 +22,7 @@ struct RelayConfigView: View {
|
||||
|
||||
var recommended: [RelayDescriptor] {
|
||||
let rs: [RelayDescriptor] = []
|
||||
return BOOTSTRAP_RELAYS.reduce(into: rs) { xs, x in
|
||||
return state.bootstrap_relays.reduce(into: rs) { xs, x in
|
||||
if state.pool.get_relay(x) == nil {
|
||||
xs.append(RelayDescriptor(url: URL(string: x)!, info: .rw))
|
||||
}
|
||||
|
||||
@@ -90,7 +90,8 @@ struct SaveKeysView: View {
|
||||
}
|
||||
|
||||
func complete_account_creation(_ account: CreateAccountModel) {
|
||||
for relay in BOOTSTRAP_RELAYS {
|
||||
let bootstrap_relays = load_bootstrap_relays(pubkey: account.pubkey)
|
||||
for relay in bootstrap_relays {
|
||||
add_rw_relay(self.pool, relay)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user