Asks pin and passphrase if device is not ready

This commit is contained in:
nicolas.dorier
2019-11-24 22:51:13 +09:00
parent 2e0db1a430
commit 287fbc523f
2 changed files with 8 additions and 2 deletions

View File

@@ -74,12 +74,17 @@ namespace BTCPayServer.Controllers
await websocketHelper.Send("{ \"error\": \"need-device\"}", cancellationToken);
return true;
}
if (deviceEntry.NeedsPinSent is true && pin is null)
if (deviceEntry.Code is HwiErrorCode.DeviceNotInitialized)
{
await websocketHelper.Send("{ \"error\": \"need-initialized\"}", cancellationToken);
return true;
}
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPinSent is true) && pin is null)
{
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
return true;
}
if (deviceEntry.NeedsPassphraseSent is true && password == null)
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPassphraseSent is true) && password == null)
{
await websocketHelper.Send("{ \"error\": \"need-passphrase\"}", cancellationToken);
return true;