mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-19 15:04:19 +01:00
Trying to fix TrezorT
This commit is contained in:
@@ -82,16 +82,26 @@ namespace BTCPayServer.Controllers
|
|||||||
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPinSent is true)
|
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPinSent is true)
|
||||||
&& !pinProvided)
|
&& !pinProvided)
|
||||||
{
|
{
|
||||||
if (IsTrezorT(deviceEntry))
|
if (!IsTrezorT(deviceEntry))
|
||||||
{
|
{
|
||||||
await websocketHelper.Send("{ \"error\": \"need-pin-on-device\"}", cancellationToken);
|
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
|
try
|
||||||
|
{
|
||||||
|
// On trezor T this will prompt the password!
|
||||||
|
await device.PromptPinAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
|
catch (HwiException ex) when (ex.ErrorCode == HwiErrorCode.DeviceAlreadyUnlocked)
|
||||||
|
{
|
||||||
|
pinProvided = true;
|
||||||
|
}
|
||||||
|
await websocketHelper.Send("{ \"error\": \"need-passphrase-on-device\"}", cancellationToken);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPassphraseSent is true) && password == null)
|
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPassphraseSent is true) && password == null)
|
||||||
{
|
{
|
||||||
if (IsTrezorT(deviceEntry))
|
if (IsTrezorT(deviceEntry))
|
||||||
|
|||||||
Reference in New Issue
Block a user