mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
SnodeAPI scope
This commit is contained in:
parent
3870ea42b7
commit
905acab3f4
@ -138,7 +138,7 @@ object SnodeAPI {
|
||||
JsonUtil.fromJson(it.body ?: throw Error.Generic, Map::class.java)
|
||||
}
|
||||
|
||||
else -> GlobalScope.asyncPromise {
|
||||
else -> scope.asyncPromise {
|
||||
HTTP.execute(
|
||||
HTTP.Verb.POST,
|
||||
url = "${snode.address}:${snode.port}/storage_rpc/v1",
|
||||
@ -191,7 +191,7 @@ object SnodeAPI {
|
||||
}
|
||||
|
||||
internal fun getRandomSnode(): Promise<Snode, Exception> =
|
||||
snodePool.takeIf { it.size >= minimumSnodePoolCount }?.secureRandom()?.let { Promise.of(it) } ?: GlobalScope.asyncPromise {
|
||||
snodePool.takeIf { it.size >= minimumSnodePoolCount }?.secureRandom()?.let { Promise.of(it) } ?: scope.asyncPromise {
|
||||
val target = seedNodePool.random()
|
||||
Log.d("Loki", "Populating snode pool using: $target.")
|
||||
val url = "$target/json_rpc"
|
||||
@ -240,7 +240,7 @@ object SnodeAPI {
|
||||
}
|
||||
|
||||
// Public API
|
||||
fun getAccountID(onsName: String): Promise<String, Exception> = GlobalScope.asyncPromise {
|
||||
fun getAccountID(onsName: String): Promise<String, Exception> = scope.asyncPromise {
|
||||
val validationCount = 3
|
||||
val accountIDByteCount = 33
|
||||
// Hash the ONS name using BLAKE2b
|
||||
|
Loading…
Reference in New Issue
Block a user