Skip to content

Commit

Permalink
Hide account age verification salt for altcoin accounts
Browse files Browse the repository at this point in the history
The salt for account age verification is not relevant for altcoins,
so hide the field.

Fixes bisq-network#2537
  • Loading branch information
devinbileck committed Sep 10, 2019
1 parent 322fe23 commit 0a606b4
Showing 1 changed file with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,27 +189,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 0a606b4

Please sign in to comment.