Skip to content

[Android] - initWallet - descriptor not always defined #75

@Czino

Description

@Czino

With the new PR, we encounter a new occasional error, it appears often only once or twice and then not again during the session.

The _descriptor[descriptor] is not defined. Possibly a racing condition caused by wrapping every method in a Thread

fun walletInit(
descriptor: String,
changeDescriptor: String? = null,
network: String,
dbConfigID: String,
result: Promise
) {
Thread {
try {
val id = randomId()
_wallets[id] = Wallet(
_descriptors[descriptor]!!,
if (changeDescriptor != null) _descriptors[changeDescriptor]!! else null,
setNetwork(network),
_databaseConfigs[dbConfigID]!!
)
result.resolve(id)
} catch (error: Throwable) {
result.reject("Init wallet error", error.localizedMessage, error)
}
}.start()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions