Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Czino opened this issue Jan 29, 2024 · 3 comments
Open

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

Czino opened this issue Jan 29, 2024 · 3 comments

Comments

@Czino
Copy link
Contributor

Czino commented Jan 29, 2024

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()
}

@Czino
Copy link
Contributor Author

Czino commented Jan 29, 2024

The odd thing is, that functions such as newBip84 return the descriptor id for use.

@BitcoinZavior
Copy link
Contributor

Managed to replicate this issue, we should have a fix shortly 👍

@BitcoinZavior
Copy link
Contributor

Managed to replicate this issue, we should have a fix shortly 👍

PR Updated, please see if you still have the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants