Fix crash when you have invalid relays in your relay list

Changelog-Fixed: Fix crash when you have invalid relays in your relay list
This commit is contained in:
William Casarin
2023-04-25 15:06:09 -07:00
parent 633fcd69a8
commit d074d092a2
13 changed files with 51 additions and 45 deletions

View File

@@ -14,8 +14,8 @@ public struct RelayInfo: Codable {
static let rw = RelayInfo(read: true, write: true)
}
public struct RelayDescriptor: Codable {
public let url: URL
public struct RelayDescriptor {
public let url: RelayURL
public let info: RelayInfo
}
@@ -79,6 +79,6 @@ enum RelayError: Error {
case RelayNotFound
}
func get_relay_id(_ url: URL) -> String {
return url.absoluteString
func get_relay_id(_ url: RelayURL) -> String {
return url.url.absoluteString
}