Skip to content

Commit

Permalink
allow editing of the output descriptor of a new account on a watch on…
Browse files Browse the repository at this point in the history
…ly wallet
  • Loading branch information
craigraw committed Apr 22, 2024
1 parent 3e870f3 commit 1887e1c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ private void setDescriptorText(String text) {
}

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()
Expand Down Expand Up @@ -769,7 +774,7 @@ private void setInputFieldsDisabled(boolean disabled) {
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
Expand Down

0 comments on commit 1887e1c

Please sign in to comment.