|
|
@ -51,11 +51,11 @@ final class IP2Country {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func populateCacheIfNeeded() -> Bool {
|
|
|
|
func populateCacheIfNeeded() -> Bool {
|
|
|
|
if OnionRequestAPI.paths.count < OnionRequestAPI.pathCount {
|
|
|
|
if OnionRequestAPI.paths.isEmpty {
|
|
|
|
OnionRequestAPI.paths = Storage.getOnionRequestPaths()
|
|
|
|
OnionRequestAPI.paths = Storage.getOnionRequestPaths()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let paths = OnionRequestAPI.paths
|
|
|
|
let paths = OnionRequestAPI.paths
|
|
|
|
guard paths.count >= OnionRequestAPI.pathCount else { return false }
|
|
|
|
guard !paths.isEmpty else { return false }
|
|
|
|
let pathToDisplay = paths.first!
|
|
|
|
let pathToDisplay = paths.first!
|
|
|
|
pathToDisplay.forEach { snode in
|
|
|
|
pathToDisplay.forEach { snode in
|
|
|
|
let _ = self.cacheCountry(for: snode.ip) // Preload if needed
|
|
|
|
let _ = self.cacheCountry(for: snode.ip) // Preload if needed
|
|
|
|