From 31affa69eaff0685abcbb25f8126d905f1e16d5f Mon Sep 17 00:00:00 2001 From: fossephate Date: Tue, 24 Sep 2024 13:20:04 -0700 Subject: [PATCH] [skip ci] minor --- cw_bitcoin/lib/litecoin_wallet.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cw_bitcoin/lib/litecoin_wallet.dart b/cw_bitcoin/lib/litecoin_wallet.dart index 1152603e5..7a52d1f2a 100644 --- a/cw_bitcoin/lib/litecoin_wallet.dart +++ b/cw_bitcoin/lib/litecoin_wallet.dart @@ -300,11 +300,6 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { } else if (resp.mwebUtxosHeight < nodeHeight) { syncStatus = SyncingSyncStatus(1, 0.999); } else { - // prevent unnecessary reaction triggers: - if (syncStatus is! SyncedSyncStatus) { - syncStatus = SyncedSyncStatus(); - } - if (resp.mwebUtxosHeight > walletInfo.restoreHeight) { await walletInfo.updateRestoreHeight(resp.mwebUtxosHeight); await checkMwebUtxosSpent(); @@ -319,6 +314,11 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { } await transactionHistory.save(); } + + // prevent unnecessary reaction triggers: + if (syncStatus is! SyncedSyncStatus) { + syncStatus = SyncedSyncStatus(); + } return; } }); @@ -488,6 +488,11 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { throw Exception("failed to get utxos stream!"); } _utxoStream = responseStream.listen((Utxo sUtxo) async { + // we're processing utxos, so our balance could still be innacurate: + if (syncStatus is! SyncronizingSyncStatus && syncStatus is! SyncingSyncStatus) { + syncStatus = SyncronizingSyncStatus(); + } + final utxo = MwebUtxo( address: sUtxo.address, blockTime: sUtxo.blockTime,