Skip to content

Commit

Permalink
Fixed descriptor error
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinZavior committed Feb 5, 2024
1 parent 91ae30f commit 3ae4cc5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions android/src/main/java/io/ltbl/bdkrn/BdkRnModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -411,20 +411,22 @@ class BdkRnModule(reactContext: ReactApplicationContext) :
dbConfigID: String,
result: Promise
) {
Thread {
try {
val id = randomId()
try {
val id = randomId()
val nativeDescriptor = _descriptors[descriptor]!!
val nativeChangeDescriptor = if (changeDescriptor != null) _descriptors[changeDescriptor]!! else null
Thread {
_wallets[id] = Wallet(
_descriptors[descriptor]!!,
if (changeDescriptor != null) _descriptors[changeDescriptor]!! else null,
nativeDescriptor,
nativeChangeDescriptor,
setNetwork(network),
_databaseConfigs[dbConfigID]!!
)
result.resolve(id)
} catch (error: Throwable) {
result.reject("Init wallet error", error.localizedMessage, error)
}
}.start()
}.start()
} catch (error: Throwable) {
result.reject("Init wallet error", error.localizedMessage, error)
}
}

@ReactMethod
Expand Down

0 comments on commit 3ae4cc5

Please sign in to comment.