From a936a3b6610ca81b025342d290dc26ec95a6f458 Mon Sep 17 00:00:00 2001 From: Hector Chu Date: Sun, 28 Apr 2024 19:46:07 +0100 Subject: [PATCH] Update balance after sending --- cw_bitcoin/lib/litecoin_wallet.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cw_bitcoin/lib/litecoin_wallet.dart b/cw_bitcoin/lib/litecoin_wallet.dart index 6cabcc34e..4c589b134 100644 --- a/cw_bitcoin/lib/litecoin_wallet.dart +++ b/cw_bitcoin/lib/litecoin_wallet.dart @@ -399,6 +399,10 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { return TxWitnessInput(stack: [key.signInput(digest), key.getPublic().toHex()]); }).toList()).toHex(); tx.outputs = resp.outputId; - return tx; + return tx..addListener((transaction) async { + transaction.inputAddresses?.forEach(mwebUtxos.remove); + await updateUnspent(); + await updateBalance(); + }); } }