Skip to content

Commit

Permalink
Merge pull request #3237 from devinbileck/hide-altcoin-account-age-salt
Browse files Browse the repository at this point in the history
Hide account age verification salt for altcoin accounts
  • Loading branch information
sqrrm authored Sep 25, 2019
2 parents 490eaab + 0a606b4 commit 8f3cf65
Showing 1 changed file with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,29 @@ else if (!paymentAccount.getTradeCurrencies().isEmpty())
else
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText);

if (isAddAccountScreen) {
InputTextField inputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0);
inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
inputTextField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.isEmpty()) {
try {
// test if input is hex
Utilities.decodeFromHex(newValue);

paymentAccount.setSaltAsHex(newValue);
} catch (Throwable t) {
new Popup().warning(Res.get("payment.error.noHexSalt")).show();
inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
log.warn(t.toString());
if (!(paymentAccount instanceof AssetAccount)) {
if (isAddAccountScreen) {
InputTextField inputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0);
inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
inputTextField.textProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.isEmpty()) {
try {
// test if input is hex
Utilities.decodeFromHex(newValue);

paymentAccount.setSaltAsHex(newValue);
} catch (Throwable t) {
new Popup().warning(Res.get("payment.error.noHexSalt")).show();
inputTextField.setText(Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
log.warn(t.toString());
}
}
}
});
} else {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.salt",
Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())),
Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
});
} else {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.salt",
Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt())),
Utilities.bytesAsHexString(paymentAccount.getPaymentAccountPayload().getSalt()));
}
}
}

Expand Down

0 comments on commit 8f3cf65

Please sign in to comment.