From 6845dc6a8b8a2682757ea318d8f9d689f135918e Mon Sep 17 00:00:00 2001 From: jwinterm Date: Thu, 14 May 2026 08:39:55 -0400 Subject: [PATCH] Disable Lightning across UI surfaces (FeatureFlag.isLightningEnabled = false) - Add FeatureFlag.isLightningEnabled flag (off) - Gate dashboard_view_model.hasLightning behind the flag, which transitively hides the LightningSwitcher in TopBar and the Lightning Username settings row (both already gated on hasLightning) - Remove CryptoCurrency.btcln from CryptoCurrency.all so it stops appearing in any all-currencies pickers/lists Lightning code paths (cw_bitcoin/lib/lightning/, lightning send/receive pages) are intentionally left in place so the flag can be flipped back on once we have an LSP / Greenlight node lined up. --- cw_core/lib/crypto_currency.dart | 2 +- lib/utils/feature_flag.dart | 3 +++ lib/view_model/dashboard/dashboard_view_model.dart | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cw_core/lib/crypto_currency.dart b/cw_core/lib/crypto_currency.dart index e620211cc..0a904099c 100644 --- a/cw_core/lib/crypto_currency.dart +++ b/cw_core/lib/crypto_currency.dart @@ -35,7 +35,7 @@ class CryptoCurrency extends EnumerableItem with Serializable implemen static const all = [ CryptoCurrency.xmr, CryptoCurrency.btc, - CryptoCurrency.btcln, + // CryptoCurrency.btcln, // Hash Wallet: Lightning disabled, see FeatureFlag.isLightningEnabled CryptoCurrency.eth, CryptoCurrency.ltc, CryptoCurrency.doge, diff --git a/lib/utils/feature_flag.dart b/lib/utils/feature_flag.dart index c692c90d2..b80d9f6df 100644 --- a/lib/utils/feature_flag.dart +++ b/lib/utils/feature_flag.dart @@ -7,6 +7,9 @@ class FeatureFlag { static const bool isCakePayPurchaseSimulationEnabled = true; static const bool isCakePayRedemptionFlowEnabled = false; static const bool isExolixEnabled = true; + // Hash Wallet: Lightning disabled — running Greenlight/LSP infra is out of + // scope for now. Re-enable once we have an LSP relationship lined up. + static const bool isLightningEnabled = false; static const bool isBackgroundSyncEnabled = true; static bool get isInAppTorEnabled => CakeTor.instance is! CakeTorDisabled; static const int verificationWordsCount = kDebugMode || kProfileMode ? 0 : 2; diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart index 8b249c8cf..a7e914acc 100644 --- a/lib/view_model/dashboard/dashboard_view_model.dart +++ b/lib/view_model/dashboard/dashboard_view_model.dart @@ -15,6 +15,7 @@ import 'package:cake_wallet/entities/service_status.dart'; import 'package:cake_wallet/entities/sync_status_display_mode.dart'; import 'package:cake_wallet/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/utils/feature_flag.dart'; import 'package:cake_wallet/monero/monero.dart'; import 'package:cake_wallet/nano/nano.dart'; import 'package:cake_wallet/order/order_provider_description.dart'; @@ -709,7 +710,10 @@ abstract class DashboardViewModelBase with Store { @computed bool get hasLightning => - wallet.type == WalletType.bitcoin && wallet.isSoftwareWallet && bitcoin!.useLightning(wallet); + FeatureFlag.isLightningEnabled && + wallet.type == WalletType.bitcoin && + wallet.isSoftwareWallet && + bitcoin!.useLightning(wallet); @computed bool get hasWalletConnect =>