mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
allow editing of the output descriptor of a new account on a watch only wallet
This commit is contained in:
parent
3e870f362d
commit
1887e1c7b0
1 changed files with 6 additions and 1 deletions
|
@ -464,6 +464,11 @@ public class SettingsController extends WalletFormController implements Initiali
|
|||
}
|
||||
|
||||
private void rederiveAndReplaceWallet(Wallet editedWallet) {
|
||||
if(!walletForm.getWallet().isMasterWallet() && (editedWallet.getPolicyType() != walletForm.getMasterWallet().getPolicyType() || editedWallet.getScriptType() != walletForm.getMasterWallet().getScriptType())) {
|
||||
AppServices.showErrorDialog("Policy or Script Type Mismatch", "The provided output descriptor does not match the policy or script type of this wallet.");
|
||||
return;
|
||||
}
|
||||
|
||||
boolean rederive = false;
|
||||
for(Keystore keystore : editedWallet.getKeystores()) {
|
||||
Optional<Keystore> optExisting = walletForm.getWallet().getKeystores().stream()
|
||||
|
@ -769,7 +774,7 @@ public class SettingsController extends WalletFormController implements Initiali
|
|||
policyType.setDisable(disabled);
|
||||
scriptType.setDisable(disabled);
|
||||
multisigControl.setDisable(disabled);
|
||||
editDescriptor.setVisible(!disabled);
|
||||
editDescriptor.setVisible(!disabled || (!walletForm.getWallet().isValid() && walletForm.getMasterWallet().getKeystores().stream().allMatch(k -> k.getSource() == KeystoreSource.SW_WATCH)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue