mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-01-26 02:11:10 +00:00
Merge pull request #1591 from Toporin/patch-satochip-multisig
default to first keystore for signing path if satochip keystore cannot be determined
This commit is contained in:
commit
7ef51e6a5d
1 changed files with 9 additions and 3 deletions
|
@ -164,8 +164,9 @@ public class SatoCardApi extends CardApi {
|
|||
for(PSBTInput psbtInput : psbt.getPsbtInputs()) {
|
||||
if(!psbtInput.isSigned()) {
|
||||
WalletNode signingNode = signingNodes.get(psbtInput);
|
||||
String fullPath = null;
|
||||
List<Keystore> keystores = wallet.getKeystores();
|
||||
// recover derivation path from Satochip keystore
|
||||
String fullPath = null;
|
||||
for(int i = 0; i < keystores.size(); i++) {
|
||||
Keystore keystore = keystores.get(i);
|
||||
WalletModel walletModel = keystore.getWalletModel();
|
||||
|
@ -173,11 +174,16 @@ public class SatoCardApi extends CardApi {
|
|||
String basePath = keystore.getKeyDerivation().getDerivationPath();
|
||||
String extendedPath = signingNode.getDerivationPath().substring(1);
|
||||
fullPath = basePath + extendedPath;
|
||||
keystore.getPubKey(signingNode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fullPath == null) {
|
||||
// recover a default derivation path from first keystore
|
||||
Keystore keystore = keystores.get(0);
|
||||
String basePath = keystore.getKeyDerivation().getDerivationPath();
|
||||
String extendedPath = signingNode.getDerivationPath().substring(1);
|
||||
fullPath = basePath + extendedPath;
|
||||
}
|
||||
psbtInput.sign(new CardPSBTInputSigner(signingNode, fullPath));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue