diff --git a/BTCPayServer.Client/BTCPayServer.Client.csproj b/BTCPayServer.Client/BTCPayServer.Client.csproj index c55280b89..dc8156bad 100644 --- a/BTCPayServer.Client/BTCPayServer.Client.csproj +++ b/BTCPayServer.Client/BTCPayServer.Client.csproj @@ -27,7 +27,7 @@ - + diff --git a/BTCPayServer.Rating/BTCPayServer.Rating.csproj b/BTCPayServer.Rating/BTCPayServer.Rating.csproj index ead28aff7..f6c2529b6 100644 --- a/BTCPayServer.Rating/BTCPayServer.Rating.csproj +++ b/BTCPayServer.Rating/BTCPayServer.Rating.csproj @@ -6,7 +6,7 @@ - + diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 933011a77..f9e7c2b81 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -45,7 +45,7 @@ - + diff --git a/BTCPayServer/Controllers/GreenField/ServerInfoController.cs b/BTCPayServer/Controllers/GreenField/ServerInfoController.cs index faacc4d8c..07331c239 100644 --- a/BTCPayServer/Controllers/GreenField/ServerInfoController.cs +++ b/BTCPayServer/Controllers/GreenField/ServerInfoController.cs @@ -32,7 +32,7 @@ namespace BTCPayServer.Controllers.GreenField [Authorize(AuthenticationSchemes = AuthenticationSchemes.Greenfield)] [HttpGet("~/api/v1/server/info")] - public async Task ServerInfo() + public ActionResult ServerInfo() { var supportedPaymentMethods = _paymentMethodHandlerDictionary .SelectMany(handler => handler.GetSupportedPaymentMethods().Select(id => id.ToString())) diff --git a/BTCPayServer/Controllers/VaultController.cs b/BTCPayServer/Controllers/VaultController.cs index 677a1359c..a4a5bc358 100644 --- a/BTCPayServer/Controllers/VaultController.cs +++ b/BTCPayServer/Controllers/VaultController.cs @@ -40,6 +40,7 @@ namespace BTCPayServer.Controllers if (!HttpContext.WebSockets.IsWebSocketRequest) return NotFound(); cryptoCode = cryptoCode ?? walletId.CryptoCode; + bool versionChecked = false; using (var cts = new CancellationTokenSource(TimeSpan.FromMinutes(10))) { var cancellationToken = cts.Token; @@ -272,6 +273,16 @@ namespace BTCPayServer.Controllers goto askdevice; case "ask-device": askdevice: + if (!versionChecked) + { + var version = await hwi.GetVersionAsync(cancellationToken); + if (version.Major < 2) + { + await websocketHelper.Send("{ \"error\": \"vault-outdated\"}", cancellationToken); + continue; + } + versionChecked = true; + } password = null; deviceEntry = null; device = null; diff --git a/BTCPayServer/Payments/Lightning/LightningListener.cs b/BTCPayServer/Payments/Lightning/LightningListener.cs index aa0735476..7cb133162 100644 --- a/BTCPayServer/Payments/Lightning/LightningListener.cs +++ b/BTCPayServer/Payments/Lightning/LightningListener.cs @@ -167,7 +167,7 @@ namespace BTCPayServer.Payments.Lightning } })); - leases.Add(_Aggregator.Subscribe(async inv => + leases.Add(_Aggregator.Subscribe(inv => { if (inv.PaymentMethodId.PaymentType == LightningPaymentType.Instance) { diff --git a/BTCPayServer/wwwroot/js/vaultbridge.js b/BTCPayServer/wwwroot/js/vaultbridge.js index 26a9bc9de..c43efb42f 100644 --- a/BTCPayServer/wwwroot/js/vaultbridge.js +++ b/BTCPayServer/wwwroot/js/vaultbridge.js @@ -1,4 +1,4 @@ -var vault = (function () { +var vault = (function () { /** @param {WebSocket} websocket */ function VaultBridge(websocket) { @@ -97,7 +97,7 @@ notRunning: "NotRunning", denied: "Denied", socketNotSupported: "SocketNotSupported", - socketError: "SocketError", + socketError: "SocketError" }, askVaultPermission: askVaultPermission, connectToBackendSocket: connectToBackendSocket, diff --git a/BTCPayServer/wwwroot/js/vaultbridge.ui.js b/BTCPayServer/wwwroot/js/vaultbridge.ui.js index d73c9949a..39d062ef6 100644 --- a/BTCPayServer/wwwroot/js/vaultbridge.ui.js +++ b/BTCPayServer/wwwroot/js/vaultbridge.ui.js @@ -32,6 +32,7 @@ var vaultui = (function () { noWebsockets: new VaultFeedback("failed", "Web sockets are not supported by the browser.", "vault-feedback1", "no-websocket"), errorWebsockets: new VaultFeedback("failed", "Error of the websocket while connecting to the backend.", "vault-feedback1", "error-websocket"), bridgeConnected: new VaultFeedback("ok", "BTCPayServer successfully connected to the vault.", "vault-feedback1", "bridge-connected"), + vaultNeedUpdate: new VaultFeedback("failed", "Your BTCPay Server Vault version is outdated. Please download the latest version.", "vault-feedback2", "vault-outdated"), noDevice: new VaultFeedback("failed", "No device connected.", "vault-feedback2", "no-device"), needInitialized: new VaultFeedback("failed", "The device has not been initialized.", "vault-feedback2", "need-initialized"), fetchingDevice: new VaultFeedback("?", "Fetching device...", "vault-feedback2", "fetching-device"),