mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
prevent setting separate passwords on child wallets
This commit is contained in:
parent
56e3a54ae0
commit
429b733140
1 changed files with 5 additions and 4 deletions
|
@ -588,14 +588,15 @@ public class SettingsController extends WalletFormController implements Initiali
|
||||||
|
|
||||||
key = new Key(encryptionFullKey.getPrivKeyBytes(), walletForm.getStorage().getKeyDeriver().getSalt(), EncryptionType.Deriver.ARGON2);
|
key = new Key(encryptionFullKey.getPrivKeyBytes(), walletForm.getStorage().getKeyDeriver().getSalt(), EncryptionType.Deriver.ARGON2);
|
||||||
|
|
||||||
|
Wallet masterWallet = walletForm.getWallet().isMasterWallet() ? walletForm.getWallet() : walletForm.getWallet().getMasterWallet();
|
||||||
if(dlg.isChangePassword()) {
|
if(dlg.isChangePassword()) {
|
||||||
if(dlg.isDeleteBackups()) {
|
if(dlg.isDeleteBackups()) {
|
||||||
walletForm.deleteBackups();
|
walletForm.deleteBackups();
|
||||||
}
|
}
|
||||||
|
|
||||||
walletForm.getStorage().setEncryptionPubKey(null);
|
walletForm.getStorage().setEncryptionPubKey(null);
|
||||||
walletForm.getWallet().decrypt(key);
|
masterWallet.decrypt(key);
|
||||||
for(Wallet childWallet : walletForm.getWallet().getChildWallets()) {
|
for(Wallet childWallet : masterWallet.getChildWallets()) {
|
||||||
childWallet.decrypt(key);
|
childWallet.decrypt(key);
|
||||||
}
|
}
|
||||||
saveWallet(true, false);
|
saveWallet(true, false);
|
||||||
|
@ -606,8 +607,8 @@ public class SettingsController extends WalletFormController implements Initiali
|
||||||
walletForm.deleteBackups();
|
walletForm.deleteBackups();
|
||||||
}
|
}
|
||||||
|
|
||||||
walletForm.getWallet().encrypt(key);
|
masterWallet.encrypt(key);
|
||||||
for(Wallet childWallet : walletForm.getWallet().getChildWallets()) {
|
for(Wallet childWallet : masterWallet.getChildWallets()) {
|
||||||
childWallet.encrypt(key);
|
childWallet.encrypt(key);
|
||||||
}
|
}
|
||||||
walletForm.getStorage().setEncryptionPubKey(encryptionPubKey);
|
walletForm.getStorage().setEncryptionPubKey(encryptionPubKey);
|
||||||
|
|
Loading…
Reference in a new issue