mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-19 23:36:00 -04:00
Add check for neg. coins
This commit is contained in:
parent
f9a33a00ff
commit
edbb7ddcc7
@ -41,7 +41,7 @@ public class AddressTextField extends AnchorPane {
|
||||
|
||||
private final StringProperty address = 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() {
|
||||
if (amountAsCoin.get().isNegative()) {
|
||||
log.warn("Amount must not be negative");
|
||||
setAmountAsCoin(Coin.ZERO);
|
||||
}
|
||||
|
||||
return address.get() != null ? BitcoinURI.convertToBitcoinURI(address.get(), amountAsCoin.get(),
|
||||
paymentLabel.get(), null) : "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user