mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 12:16:27 -04:00
Add check for neg. coins
This commit is contained in:
parent
f9a33a00ff
commit
edbb7ddcc7
1 changed files with 6 additions and 1 deletions
|
@ -41,7 +41,7 @@ public class AddressTextField extends AnchorPane {
|
||||||
|
|
||||||
private final StringProperty address = new SimpleStringProperty();
|
private final StringProperty address = new SimpleStringProperty();
|
||||||
private final StringProperty paymentLabel = new SimpleStringProperty();
|
private final StringProperty paymentLabel = new SimpleStringProperty();
|
||||||
private final ObjectProperty<Coin> amountAsCoin = new SimpleObjectProperty<>();
|
private final ObjectProperty<Coin> amountAsCoin = new SimpleObjectProperty<>(Coin.ZERO);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -142,6 +142,11 @@ public class AddressTextField extends AnchorPane {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private String getBitcoinURI() {
|
private String getBitcoinURI() {
|
||||||
|
if (amountAsCoin.get().isNegative()) {
|
||||||
|
log.warn("Amount must not be negative");
|
||||||
|
setAmountAsCoin(Coin.ZERO);
|
||||||
|
}
|
||||||
|
|
||||||
return address.get() != null ? BitcoinURI.convertToBitcoinURI(address.get(), amountAsCoin.get(),
|
return address.get() != null ? BitcoinURI.convertToBitcoinURI(address.get(), amountAsCoin.get(),
|
||||||
paymentLabel.get(), null) : "";
|
paymentLabel.get(), null) : "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue