Fix: No need to select the Signing Key for signing through multi sig process (#6674)

This commit is contained in:
Nicolas Dorier
2025-04-21 17:11:50 +09:00
committed by GitHub
parent 541e514d9f
commit a2d94a265b
5 changed files with 35 additions and 24 deletions

View File

@@ -582,9 +582,13 @@ namespace BTCPayServer.Controllers.Greenfield
var signingKey = ExtKey.Parse(signingKeyStr, network.NBitcoinNetwork);
var signingKeySettings = derivationScheme.GetSigningAccountKeySettings();
signingKeySettings.RootFingerprint ??= signingKey.GetPublicKey().GetHDFingerPrint();
RootedKeyPath rootedKeyPath = signingKeySettings.GetRootedKeyPath();
var signingKeySettings = derivationScheme.GetSigningAccountKeySettings(signingKey);
RootedKeyPath? rootedKeyPath = signingKeySettings?.GetRootedKeyPath();
if (rootedKeyPath is null || signingKeySettings is null)
{
return this.CreateAPIError(503, "not-available",
"The private key saved for this wallet doesn't match the derivation scheme");
}
psbt.PSBT.RebaseKeyPaths(signingKeySettings.AccountKey, rootedKeyPath);
var accountKey = signingKey.Derive(rootedKeyPath.KeyPath);