mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Use EnforceLowR suggestion of NBXplorer for signing
This commit is contained in:
parent
35432d919c
commit
77f6019d82
@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NBitcoin" Version="5.0.38" />
|
||||
<PackageReference Include="NBitcoin" Version="5.0.39" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -324,7 +324,10 @@ namespace BTCPayServer.Controllers
|
||||
var extKey = ExtKey.Parse(vm.SigningKey, network.NBitcoinNetwork);
|
||||
proposedPayjoin = proposedPayjoin.SignAll(derivationSchemeSettings.AccountDerivation,
|
||||
extKey,
|
||||
RootedKeyPath.Parse(vm.SigningKeyPath));
|
||||
RootedKeyPath.Parse(vm.SigningKeyPath), new SigningOptions()
|
||||
{
|
||||
EnforceLowR = !(vm.SigningContext?.EnforceLowR is false)
|
||||
});
|
||||
vm.SigningContext.PSBT = proposedPayjoin.ToBase64();
|
||||
vm.SigningContext.OriginalPSBT = psbt.ToBase64();
|
||||
proposedPayjoin.Finalize();
|
||||
|
@ -914,7 +914,10 @@ namespace BTCPayServer.Controllers
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
var changed = PSBTChanged(psbt, () => psbt.SignAll(settings.AccountDerivation, signingKey, rootedKeyPath));
|
||||
var changed = PSBTChanged(psbt, () => psbt.SignAll(settings.AccountDerivation, signingKey, rootedKeyPath, new SigningOptions()
|
||||
{
|
||||
EnforceLowR = !(viewModel.SigningContext?.EnforceLowR is false)
|
||||
}));
|
||||
if (!changed)
|
||||
{
|
||||
ModelState.AddModelError(nameof(viewModel.SeedOrKey), "Impossible to sign the transaction. Probable cause: Incorrect account key path in wallet settings, PSBT already signed.");
|
||||
|
10
BTCPayServer/Views/Wallets/SigningContext.cshtml
Normal file
10
BTCPayServer/Views/Wallets/SigningContext.cshtml
Normal file
@ -0,0 +1,10 @@
|
||||
@model BTCPayServer.Models.WalletViewModels.SigningContextModel
|
||||
|
||||
@if (Model != null)
|
||||
{
|
||||
<input type="hidden" asp-for="PSBT" />
|
||||
<input type="hidden" asp-for="OriginalPSBT" />
|
||||
<input type="hidden" asp-for="PayJoinEndpointUrl" />
|
||||
<input type="hidden" asp-for="EnforceLowR" />
|
||||
<input type="hidden" asp-for="ChangeAddress" />
|
||||
}
|
Loading…
Reference in New Issue
Block a user