diff --git a/BTCPayServer.Common/BTCPayNetworkProvider.cs b/BTCPayServer.Common/BTCPayNetworkProvider.cs index 8407ff5c9..67fc1f27a 100644 --- a/BTCPayServer.Common/BTCPayNetworkProvider.cs +++ b/BTCPayServer.Common/BTCPayNetworkProvider.cs @@ -93,6 +93,7 @@ namespace BTCPayServer } public BTCPayNetwork BTC => GetNetwork("BTC"); + public BTCPayNetworkBase DefaultNetwork => BTC ?? GetAll().First(); public void Add(BTCPayNetwork network) { diff --git a/BTCPayServer/Controllers/UIInvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs index 10dd84ffa..ab59151c5 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -451,8 +451,8 @@ namespace BTCPayServer.Controllers case "cpfp": if (selectedItems.Length == 0) return NotSupported("No invoice has been selected"); - var network = _NetworkProvider.BTC; - var explorer = _ExplorerClients.GetExplorerClient(_NetworkProvider.BTC); + var network = _NetworkProvider.DefaultNetwork; + var explorer = _ExplorerClients.GetExplorerClient(network); IActionResult NotSupported(string err) { TempData[WellKnownTempData.ErrorMessage] = err; diff --git a/BTCPayServer/Views/UIStores/Dashboard.cshtml b/BTCPayServer/Views/UIStores/Dashboard.cshtml index fa9c6acef..eabcb062e 100644 --- a/BTCPayServer/Views/UIStores/Dashboard.cshtml +++ b/BTCPayServer/Views/UIStores/Dashboard.cshtml @@ -4,7 +4,7 @@ @{ ViewData.SetActivePage(StoreNavPages.Dashboard, Model.StoreName, Model.StoreId); var isReady = Model.WalletEnabled || Model.LightningEnabled; - var defaultCryptoCode = (networkProvider.BTC ?? networkProvider.GetAll().First()).CryptoCode; + var defaultCryptoCode = networkProvider.DefaultNetwork.CryptoCode; }