mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-03-26 17:51:46 +01:00
truncate keystore labels on caravan import
This commit is contained in:
parent
81eda96690
commit
1224abcd1d
@ -53,7 +53,7 @@ public class CaravanMultisig implements WalletImport, WalletExport {
|
||||
ScriptType scriptType = ScriptType.valueOf(cf.addressType.replace('-', '_'));
|
||||
|
||||
for(ExtPublicKey extKey : cf.extendedPublicKeys) {
|
||||
Keystore keystore = new Keystore(extKey.name);
|
||||
Keystore keystore = new Keystore(extKey.name.length() > Keystore.MAX_LABEL_LENGTH ? extKey.name.substring(0, Keystore.MAX_LABEL_LENGTH) : extKey.name);
|
||||
try {
|
||||
keystore.setKeyDerivation(new KeyDerivation(extKey.xfp, extKey.bip32Path));
|
||||
} catch(NumberFormatException e) {
|
||||
@ -70,6 +70,7 @@ public class CaravanMultisig implements WalletImport, WalletExport {
|
||||
keystore.setWalletModel(walletModel);
|
||||
keystore.setSource(KeystoreSource.HW_USB);
|
||||
}
|
||||
wallet.makeLabelsUnique(keystore);
|
||||
wallet.getKeystores().add(keystore);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user