mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 01:37:54 +00:00
put or update address instead of assuming it doesn't exist in db (it shouldn't exist in db though...)
This commit is contained in:
parent
af02bddef1
commit
37a164bb8f
1 changed files with 2 additions and 4 deletions
|
@ -36,7 +36,7 @@ abstract class Bip39HDWallet<T extends Bip39HDCurrency> extends Bip39Wallet<T>
|
|||
derivePathType: DerivePathTypeExt.primaryFor(info.coin),
|
||||
);
|
||||
|
||||
await mainDB.putAddress(address);
|
||||
await mainDB.updateOrPutAddresses([address]);
|
||||
await info.updateReceivingAddress(
|
||||
newAddress: address.value,
|
||||
isar: mainDB.isar,
|
||||
|
@ -58,9 +58,7 @@ abstract class Bip39HDWallet<T extends Bip39HDCurrency> extends Bip39Wallet<T>
|
|||
derivePathType: DerivePathTypeExt.primaryFor(info.coin),
|
||||
);
|
||||
|
||||
await mainDB.isar.writeTxn(() async {
|
||||
await mainDB.isar.addresses.put(address);
|
||||
});
|
||||
await mainDB.updateOrPutAddresses([address]);
|
||||
}
|
||||
|
||||
// ========== Subclasses may override ========================================
|
||||
|
|
Loading…
Reference in a new issue