From adee6ffe53be4b582911f8e0448528dc50773578 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Wed, 17 Jul 2024 14:58:35 -0700 Subject: [PATCH] more experiments --- cw_bitcoin/lib/electrum_wallet.dart | 7 +++---- cw_bitcoin/lib/litecoin_wallet.dart | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index 97d466ffe..d1b464f88 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -416,11 +416,10 @@ abstract class ElectrumWalletBase await _setInitialHeight(); } - await _subscribeForUpdates(); - - await updateTransactions(); - if (this is! LitecoinWallet) { + await _subscribeForUpdates(); + await updateTransactions(); + await updateAllUnspents(); await updateBalance(); } diff --git a/cw_bitcoin/lib/litecoin_wallet.dart b/cw_bitcoin/lib/litecoin_wallet.dart index 505ff9d8e..5cfb46709 100644 --- a/cw_bitcoin/lib/litecoin_wallet.dart +++ b/cw_bitcoin/lib/litecoin_wallet.dart @@ -179,19 +179,19 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { syncStatus = SyncedSyncStatus(); } - if (resp.mwebUtxosHeight > mwebUtxosHeight) { - mwebUtxosHeight = resp.mwebUtxosHeight; - await checkMwebUtxosSpent(); - // update the confirmations for each transaction: - for (final transaction in transactionHistory.transactions.values) { - if (transaction.isPending) continue; - final confirmations = mwebUtxosHeight - transaction.height + 1; - if (transaction.confirmations == confirmations) continue; - transaction.confirmations = confirmations; - transactionHistory.addOne(transaction); - } - await transactionHistory.save(); - } + // if (resp.mwebUtxosHeight > mwebUtxosHeight) { + // mwebUtxosHeight = resp.mwebUtxosHeight; + // await checkMwebUtxosSpent(); + // // update the confirmations for each transaction: + // for (final transaction in transactionHistory.transactions.values) { + // if (transaction.isPending) continue; + // final confirmations = mwebUtxosHeight - transaction.height + 1; + // if (transaction.confirmations == confirmations) continue; + // transaction.confirmations = confirmations; + // transactionHistory.addOne(transaction); + // } + // await transactionHistory.save(); + // } } }); processMwebUtxos();