mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
truncate long electrum wallet labels
This commit is contained in:
parent
7fc37c21fd
commit
a9a3eef157
1 changed files with 4 additions and 0 deletions
|
@ -173,6 +173,10 @@ public class Electrum implements KeystoreFileImport, WalletImport, WalletExport
|
||||||
keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, derivationPath));
|
keystore.setKeyDerivation(new KeyDerivation(masterFingerprint, derivationPath));
|
||||||
keystore.setExtendedPublicKey(xPub);
|
keystore.setExtendedPublicKey(xPub);
|
||||||
keystore.setLabel(ek.label != null ? ek.label : "Electrum");
|
keystore.setLabel(ek.label != null ? ek.label : "Electrum");
|
||||||
|
if(keystore.getLabel().length() > Keystore.MAX_LABEL_LENGTH) {
|
||||||
|
keystore.setLabel(keystore.getLabel().substring(0, Keystore.MAX_LABEL_LENGTH));
|
||||||
|
}
|
||||||
|
|
||||||
wallet.getKeystores().add(keystore);
|
wallet.getKeystores().add(keystore);
|
||||||
|
|
||||||
ExtendedKey.Header xpubHeader = ExtendedKey.Header.fromExtendedKey(ek.xpub);
|
ExtendedKey.Header xpubHeader = ExtendedKey.Header.fromExtendedKey(ek.xpub);
|
||||||
|
|
Loading…
Reference in a new issue