diff --git a/assets/text/Release_Notes.txt b/assets/text/Release_Notes.txt index 0a1424f8c..557dd8b26 100644 --- a/assets/text/Release_Notes.txt +++ b/assets/text/Release_Notes.txt @@ -1,4 +1,2 @@ Bitcoin Silent Payments -Add Tron wallet -Hardware wallets enhancements -Bug fixes +Bug fixes and generic enhancements diff --git a/cw_bitcoin/lib/electrum.dart b/cw_bitcoin/lib/electrum.dart index 0c88e234e..afd5e2440 100644 --- a/cw_bitcoin/lib/electrum.dart +++ b/cw_bitcoin/lib/electrum.dart @@ -368,12 +368,6 @@ class ElectrumClient { id: 'blockchain.headers.subscribe', method: 'blockchain.headers.subscribe'); } - BehaviorSubject? chainTipUpdate() { - _id += 1; - return subscribe( - id: 'blockchain.headers.subscribe', method: 'blockchain.headers.subscribe'); - } - BehaviorSubject? scripthashUpdate(String scripthash) { _id += 1; return subscribe( diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index bbe153de1..05ad6aefa 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -227,7 +227,6 @@ abstract class ElectrumWalletBase } } - @observable int? _currentChainTip; Future getCurrentChainTip() async { @@ -1760,12 +1759,14 @@ abstract class ElectrumWalletBase _chainTipUpdateSubject = electrumClient.chainTipSubscribe(); _chainTipUpdateSubject?.listen((e) async { final event = e as Map; - final height = int.parse(event['height'].toString()); + final height = int.tryParse(event['height'].toString()); - _currentChainTip = height; + if (height != null) { + _currentChainTip = height; - if (alwaysScan == true && syncStatus is SyncedSyncStatus) { - _setListeners(walletInfo.restoreHeight); + if (alwaysScan == true && syncStatus is SyncedSyncStatus) { + _setListeners(walletInfo.restoreHeight); + } } }); } diff --git a/lib/src/screens/rescan/rescan_page.dart b/lib/src/screens/rescan/rescan_page.dart index 521e314b3..c59ae4ad0 100644 --- a/lib/src/screens/rescan/rescan_page.dart +++ b/lib/src/screens/rescan/rescan_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/bitcoin/bitcoin.dart'; +import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:flutter/material.dart'; @@ -42,8 +43,9 @@ class RescanPage extends BasePage { return _toggleSilentPaymentsScanning(context); } - await _rescanViewModel.rescanCurrentWallet( + _rescanViewModel.rescanCurrentWallet( restoreHeight: _blockchainHeightWidgetKey.currentState!.height); + Navigator.of(context).pop(); }, color: Theme.of(context).primaryColor, @@ -55,28 +57,30 @@ class RescanPage extends BasePage { } Future _toggleSilentPaymentsScanning(BuildContext context) async { + final height = _blockchainHeightWidgetKey.currentState!.height; + + Navigator.of(context).pop(); + final needsToSwitch = await bitcoin!.getNodeIsElectrsSPEnabled(_rescanViewModel.wallet) == false; if (needsToSwitch) { return showPopUp( - context: context, - builder: (BuildContext context) => AlertWithTwoActions( - alertTitle: S.of(context).change_current_node_title, - alertContent: S.of(context).confirm_silent_payments_switch_node, - rightButtonText: S.of(context).ok, - leftButtonText: S.of(context).cancel, + context: navigatorKey.currentState!.context, + builder: (BuildContext _dialogContext) => AlertWithTwoActions( + alertTitle: S.of(_dialogContext).change_current_node_title, + alertContent: S.of(_dialogContext).confirm_silent_payments_switch_node, + rightButtonText: S.of(_dialogContext).ok, + leftButtonText: S.of(_dialogContext).cancel, actionRightButton: () async { - _rescanViewModel.rescanCurrentWallet( - restoreHeight: _blockchainHeightWidgetKey.currentState!.height); - Navigator.of(context).pop(); + Navigator.of(_dialogContext).pop(); + + _rescanViewModel.rescanCurrentWallet(restoreHeight: height); }, - actionLeftButton: () => Navigator.of(context).pop(), + actionLeftButton: () => Navigator.of(_dialogContext).pop(), )); } - await _rescanViewModel.rescanCurrentWallet( - restoreHeight: _blockchainHeightWidgetKey.currentState!.height); - Navigator.of(context).pop(); + _rescanViewModel.rescanCurrentWallet(restoreHeight: height); } } diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 82da5fa41..39ccf47e4 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -18,8 +18,8 @@ MONERO_COM_BUILD_NUMBER=87 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.17.0" -CAKEWALLET_BUILD_NUMBER=244 +CAKEWALLET_VERSION="4.18.0" +CAKEWALLET_BUILD_NUMBER=247 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index 196d49eaf..b226aac81 100755 --- a/scripts/macos/app_env.sh +++ b/scripts/macos/app_env.sh @@ -22,7 +22,7 @@ MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_VERSION="1.10.0" -CAKEWALLET_BUILD_NUMBER=76 +CAKEWALLET_BUILD_NUMBER=77 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then