mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Update HWI library, warn users to run newer version (#2544)
* Update HWI library, warn users to run newer version * Update BTCPayServer/wwwroot/js/vaultbridge.ui.js Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com> * Update BTCPayServer/wwwroot/js/vaultbridge.ui.js Co-authored-by: Pavlenex <pavle@pavle.org> Co-authored-by: Zaxounette <51208677+Zaxounette@users.noreply.github.com> Co-authored-by: Pavlenex <pavle@pavle.org>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user