mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Show proper error message if the keypath in wallet settings is not good (Fix #1209)
This commit is contained in:
@@ -138,6 +138,19 @@ namespace BTCPayServer.Controllers
|
||||
await websocketHelper.Send("{ \"error\": \"wrong-wallet\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
var signableInputs = psbt.Inputs
|
||||
.SelectMany(i => i.HDKeyPaths)
|
||||
.Where(i => i.Value.MasterFingerprint == fingerprint)
|
||||
.ToArray();
|
||||
if (signableInputs.Length > 0)
|
||||
{
|
||||
var actualPubKey = (await device.GetXPubAsync(signableInputs[0].Value.KeyPath)).GetPublicKey();
|
||||
if (actualPubKey != signableInputs[0].Key)
|
||||
{
|
||||
await websocketHelper.Send("{ \"error\": \"wrong-keypath\"}", cancellationToken);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
psbt = await device.SignPSBTAsync(psbt, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user