mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
Remove useless try/catch
This commit is contained in:
parent
1aa4dbb90d
commit
98276bcb3d
1 changed files with 2 additions and 39 deletions
|
@ -110,22 +110,9 @@ namespace BTCPayServer.Controllers
|
|||
continue;
|
||||
}
|
||||
if (fingerprint is null)
|
||||
{
|
||||
try
|
||||
{
|
||||
fingerprint = (await device.GetXPubAsync(new KeyPath("44'"), cancellationToken)).ExtPubKey.ParentFingerprint;
|
||||
}
|
||||
catch (Hwi.HwiException ex) when (ex.ErrorCode == Hwi.HwiErrorCode.DeviceNotReady)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
catch (Hwi.HwiException ex) when (ex.ErrorCode == Hwi.HwiErrorCode.NoPassword)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"need-passphrase\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
await websocketHelper.Send("{ \"info\": \"ready\"}", cancellationToken);
|
||||
o = JObject.Parse(await websocketHelper.NextMessageAsync(cancellationToken));
|
||||
var authorization = await _authorizationService.AuthorizeAsync(User, Policies.CanModifyStoreSettings.Key);
|
||||
|
@ -147,16 +134,6 @@ namespace BTCPayServer.Controllers
|
|||
{
|
||||
psbt = await device.SignPSBTAsync(psbt, cancellationToken);
|
||||
}
|
||||
catch (Hwi.HwiException ex) when (ex.ErrorCode == Hwi.HwiErrorCode.DeviceNotReady)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
catch (Hwi.HwiException ex) when (ex.ErrorCode == Hwi.HwiErrorCode.NoPassword)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"need-passphrase\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
catch (Hwi.HwiException)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"user-reject\"}", cancellationToken);
|
||||
|
@ -198,21 +175,7 @@ namespace BTCPayServer.Controllers
|
|||
JObject result = new JObject();
|
||||
var factory = network.NBXplorerNetwork.DerivationStrategyFactory;
|
||||
var keyPath = new KeyPath("84'").Derive(network.CoinType).Derive(0, true);
|
||||
BitcoinExtPubKey xpub = null;
|
||||
try
|
||||
{
|
||||
xpub = await device.GetXPubAsync(keyPath);
|
||||
}
|
||||
catch (Hwi.HwiException ex) when (ex.ErrorCode == Hwi.HwiErrorCode.DeviceNotReady)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
catch (Hwi.HwiException ex) when (ex.ErrorCode == Hwi.HwiErrorCode.NoPassword)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"need-passphrase\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
BitcoinExtPubKey xpub = await device.GetXPubAsync(keyPath);
|
||||
if (fingerprint is null)
|
||||
{
|
||||
fingerprint = (await device.GetXPubAsync(new KeyPath("44'"), cancellationToken)).ExtPubKey.ParentFingerprint;
|
||||
|
|
Loading…
Add table
Reference in a new issue