diff --git a/cw_bitcoin/lib/litecoin_wallet.dart b/cw_bitcoin/lib/litecoin_wallet.dart index 73b00b24e..8df7f62ca 100644 --- a/cw_bitcoin/lib/litecoin_wallet.dart +++ b/cw_bitcoin/lib/litecoin_wallet.dart @@ -859,6 +859,36 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store { feeRatePerKb: Int64.parseInt(tx.feeRate) * 1000, )); final tx2 = BtcTransaction.fromRaw(hex.encode(resp.rawTx)); + + // check if any of the inputs of this transaction are hog-ex: + tx2.inputs.forEach((txInput) { + bool isHogEx = true; + + final utxo = unspentCoins + .firstWhere((utxo) => utxo.hash == txInput.txId && utxo.vout == txInput.txIndex); + + if (txInput.sequence.isEmpty) { + isHogEx = false; + } + + // TODO: detect actual hog-ex inputs + // print(txInput.sequence); + // print(txInput.txIndex); + // print(utxo.value); + + if (!isHogEx) { + return; + } + + int confirmations = utxo.confirmations ?? 0; + if (confirmations < 6) { + throw Exception( + "A transaction input has less than 6 confirmations, please try again later."); + } + }); + + throw Exception("Not finished!"); + tx.hexOverride = tx2 .copyWith( witnesses: tx2.inputs.asMap().entries.map((e) { diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index 2d917c820..255bcc511 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -369,14 +369,14 @@ abstract class BalanceViewModelBase with Store { } bool _hasSecondAdditionalBalanceForWalletType(WalletType type) { - if (wallet.type == WalletType.litecoin /*&& settingsStore.mwebEnabled*/) { + if (wallet.type == WalletType.litecoin && settingsStore.mwebEnabled) { return true; } return false; } bool _hasSecondAvailableBalanceForWalletType(WalletType type) { - if (wallet.type == WalletType.litecoin /*&& settingsStore.mwebEnabled*/) { + if (wallet.type == WalletType.litecoin && settingsStore.mwebEnabled) { return true; } return false; diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart index 6e07afb3a..a45bd3fe2 100644 --- a/lib/view_model/dashboard/dashboard_view_model.dart +++ b/lib/view_model/dashboard/dashboard_view_model.dart @@ -132,8 +132,8 @@ abstract class DashboardViewModelBase with Store { FilterItem( value: () => tradeFilterStore.displayLetsExchange, caption: ExchangeProviderDescription.letsExchange.title, - onChanged: () => - tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.letsExchange)), + onChanged: () => tradeFilterStore + .toggleDisplayExchange(ExchangeProviderDescription.letsExchange)), FilterItem( value: () => tradeFilterStore.displayStealthEx, caption: ExchangeProviderDescription.stealthEx.title, @@ -443,6 +443,7 @@ abstract class DashboardViewModelBase with Store { settingsStore.hasEnabledMwebBefore = true; } + settingsStore.mwebEnabled = active; mwebScanningActive = active; bitcoin!.setMwebEnabled(wallet, active); }