Revert "Fix unavailable balance not refreshing after the app got opened (#1920)" (#1925)

This reverts commit d33a901f669b9a2a3868b4c184be5fe58a2974a6.

Omar Hatem committed Jan 2, 2025 at 18:02 UTC 0ebfd671f98e84da3455238ae7a9e841080cc5b9
2 files changed +1 -6
cw_monero/lib/monero_wallet.dart
-4
@@ -503,7 +503,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
503 }
504
505 Future<void> updateUnspent() async {
506 - await transaction_history.txHistoryMutex.acquire();
506 try {
507 refreshCoins(walletAddresses.account!.id);
508
@@ -532,7 +531,6 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
531
532 if (unspentCoinsInfo.isEmpty) {
533 unspentCoins.forEach((coin) => _addCoinInfo(coin));
535 - transaction_history.txHistoryMutex.release();
534 return;
535 }
536
@@ -557,9 +555,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
555
556 await _refreshUnspentCoinsInfo();
557 _askForUpdateBalance();
560 - transaction_history.txHistoryMutex.release();
558 } catch (e, s) {
562 - transaction_history.txHistoryMutex.release();
559 printV(e.toString());
560 onError?.call(FlutterErrorDetails(
561 exception: e,
cw_monero/lib/monero_wallet_service.dart
+1 -2
@@ -12,7 +12,6 @@ import 'package:cw_core/wallet_info.dart';
12 import 'package:cw_core/wallet_service.dart';
13 import 'package:cw_core/wallet_type.dart';
14 import 'package:cw_monero/api/account_list.dart';
15 -import 'package:cw_monero/api/transaction_history.dart';
15 import 'package:cw_monero/api/wallet_manager.dart' as monero_wallet_manager;
16 import 'package:cw_monero/api/wallet_manager.dart';
17 import 'package:cw_monero/ledger.dart';
@@ -160,7 +159,7 @@ class MoneroWalletService extends WalletService<
159 }
160
161 await wallet.init();
163 - await wallet.updateUnspent();
162 +
163 return wallet;
164 } catch (e) {
165 // TODO: Implement Exception for wallet list service.