mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Don't throw exception if derivation scheme is not found
This commit is contained in:
@@ -114,11 +114,15 @@ namespace BTCPayServer.Controllers
|
|||||||
var vm = new WalletPSBTReadyViewModel() { PSBT = psbt };
|
var vm = new WalletPSBTReadyViewModel() { PSBT = psbt };
|
||||||
vm.SigningKey = signingKey;
|
vm.SigningKey = signingKey;
|
||||||
vm.SigningKeyPath = signingKeyPath;
|
vm.SigningKeyPath = signingKeyPath;
|
||||||
await FetchTransactionDetails(walletId, vm, network);
|
|
||||||
|
var derivationSchemeSettings = await GetDerivationSchemeSettings(walletId);
|
||||||
|
if (derivationSchemeSettings == null)
|
||||||
|
return NotFound();
|
||||||
|
await FetchTransactionDetails(derivationSchemeSettings, vm, network);
|
||||||
return View(nameof(WalletPSBTReady), vm);
|
return View(nameof(WalletPSBTReady), vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task FetchTransactionDetails(WalletId walletId, WalletPSBTReadyViewModel vm, BTCPayNetwork network)
|
private Task FetchTransactionDetails(DerivationSchemeSettings derivationSchemeSettings, WalletPSBTReadyViewModel vm, BTCPayNetwork network)
|
||||||
{
|
{
|
||||||
var psbtObject = PSBT.Parse(vm.PSBT, network.NBitcoinNetwork);
|
var psbtObject = PSBT.Parse(vm.PSBT, network.NBitcoinNetwork);
|
||||||
IHDKey signingKey = null;
|
IHDKey signingKey = null;
|
||||||
@@ -141,7 +145,6 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
var derivationSchemeSettings = await GetDerivationSchemeSettings(walletId);
|
|
||||||
if (signingKey == null || signingKeyPath == null)
|
if (signingKey == null || signingKeyPath == null)
|
||||||
{
|
{
|
||||||
var signingKeySettings = derivationSchemeSettings.GetSigningAccountKeySettings();
|
var signingKeySettings = derivationSchemeSettings.GetSigningAccountKeySettings();
|
||||||
@@ -200,6 +203,7 @@ namespace BTCPayServer.Controllers
|
|||||||
{
|
{
|
||||||
vm.SetErrors(errors);
|
vm.SetErrors(errors);
|
||||||
}
|
}
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -213,7 +217,10 @@ namespace BTCPayServer.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
psbt = PSBT.Parse(vm.PSBT, network.NBitcoinNetwork);
|
psbt = PSBT.Parse(vm.PSBT, network.NBitcoinNetwork);
|
||||||
await FetchTransactionDetails(walletId, vm, network);
|
var derivationSchemeSettings = await GetDerivationSchemeSettings(walletId);
|
||||||
|
if (derivationSchemeSettings == null)
|
||||||
|
return NotFound();
|
||||||
|
await FetchTransactionDetails(derivationSchemeSettings, vm, network);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user