only clear out wallet utxos on refresh

This commit is contained in:
julian 2023-01-31 19:26:23 -06:00
parent dc2f344779
commit 588d715a61
7 changed files with 9 additions and 7 deletions

View file

@ -1858,7 +1858,7 @@ class BitcoinWallet extends CoinServiceAPI
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });
@ -2278,6 +2278,8 @@ class BitcoinWallet extends CoinServiceAPI
Logging.instance.log("spendableOutputs.length: ${spendableOutputs.length}", Logging.instance.log("spendableOutputs.length: ${spendableOutputs.length}",
level: LogLevel.Info); level: LogLevel.Info);
Logging.instance.log("availableOutputs.length: ${availableOutputs.length}",
level: LogLevel.Info);
Logging.instance Logging.instance
.log("spendableOutputs: $spendableOutputs", level: LogLevel.Info); .log("spendableOutputs: $spendableOutputs", level: LogLevel.Info);
Logging.instance.log("spendableSatoshiValue: $spendableSatoshiValue", Logging.instance.log("spendableSatoshiValue: $spendableSatoshiValue",

View file

@ -1673,7 +1673,7 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });

View file

@ -1620,7 +1620,7 @@ class DogecoinWallet extends CoinServiceAPI
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });

View file

@ -3665,7 +3665,7 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });

View file

@ -1784,7 +1784,7 @@ class LitecoinWallet extends CoinServiceAPI
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });

View file

@ -1763,7 +1763,7 @@ class NamecoinWallet extends CoinServiceAPI
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });

View file

@ -1659,7 +1659,7 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
// TODO move this out of here and into IDB // TODO move this out of here and into IDB
await db.isar.writeTxn(() async { await db.isar.writeTxn(() async {
await db.isar.utxos.clear(); await db.isar.utxos.where().walletIdEqualTo(walletId).deleteAll();
await db.isar.utxos.putAll(outputArray); await db.isar.utxos.putAll(outputArray);
}); });