mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-01-30 04:01:11 +00:00
use master wallet passphrase for child wallets when loading
This commit is contained in:
parent
7a3e1dfa1f
commit
f74287697c
1 changed files with 11 additions and 6 deletions
|
@ -872,9 +872,13 @@ public class AppController implements Initializable {
|
||||||
if(wallet.containsPrivateKeys()) {
|
if(wallet.containsPrivateKeys()) {
|
||||||
//Derive xpub and master fingerprint from seed, potentially with passphrase
|
//Derive xpub and master fingerprint from seed, potentially with passphrase
|
||||||
Wallet copy = wallet.copy();
|
Wallet copy = wallet.copy();
|
||||||
for(Keystore copyKeystore : copy.getKeystores()) {
|
for(int i = 0; i < copy.getKeystores().size(); i++) {
|
||||||
|
Keystore copyKeystore = copy.getKeystores().get(i);
|
||||||
if(copyKeystore.hasSeed()) {
|
if(copyKeystore.hasSeed()) {
|
||||||
if(copyKeystore.getSeed().needsPassphrase()) {
|
if(copyKeystore.getSeed().needsPassphrase()) {
|
||||||
|
if(!wallet.isMasterWallet() && wallet.getMasterWallet().getKeystores().size() == copy.getKeystores().size() && wallet.getMasterWallet().getKeystores().get(i).hasSeed()) {
|
||||||
|
copyKeystore.getSeed().setPassphrase(wallet.getMasterWallet().getKeystores().get(i).getSeed().getPassphrase());
|
||||||
|
} else {
|
||||||
KeystorePassphraseDialog passphraseDialog = new KeystorePassphraseDialog(wallet.getFullName(), copyKeystore);
|
KeystorePassphraseDialog passphraseDialog = new KeystorePassphraseDialog(wallet.getFullName(), copyKeystore);
|
||||||
Optional<String> optionalPassphrase = passphraseDialog.showAndWait();
|
Optional<String> optionalPassphrase = passphraseDialog.showAndWait();
|
||||||
if(optionalPassphrase.isPresent()) {
|
if(optionalPassphrase.isPresent()) {
|
||||||
|
@ -882,6 +886,7 @@ public class AppController implements Initializable {
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
copyKeystore.getSeed().setPassphrase("");
|
copyKeystore.getSeed().setPassphrase("");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue