mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-09 23:22:16 -04:00
Remove extra balance check
This commit is contained in:
parent
9506bfd17d
commit
42bf13c90d
1 changed files with 2 additions and 6 deletions
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.popups;
|
package io.bitsquare.gui.popups;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import io.bitsquare.btc.Restrictions;
|
import io.bitsquare.btc.Restrictions;
|
||||||
import io.bitsquare.btc.WalletService;
|
import io.bitsquare.btc.WalletService;
|
||||||
import io.bitsquare.common.util.Tuple2;
|
import io.bitsquare.common.util.Tuple2;
|
||||||
|
@ -95,17 +94,14 @@ public class EmptyWalletPopup extends Popup {
|
||||||
10);
|
10);
|
||||||
|
|
||||||
Coin totalBalance = walletService.getAvailableBalance();
|
Coin totalBalance = walletService.getAvailableBalance();
|
||||||
boolean isBalanceSufficient = Restrictions.isMinSpendableAmount(totalBalance);
|
|
||||||
if (totalBalance.compareTo(Coin.ZERO) > 0)
|
|
||||||
Preconditions.checkArgument(isBalanceSufficient,
|
|
||||||
"You cannot send an amount which are smaller than the fee + dust output.");
|
|
||||||
addressTextField = addLabelTextField(gridPane, ++rowIndex, "Your available wallet balance:",
|
addressTextField = addLabelTextField(gridPane, ++rowIndex, "Your available wallet balance:",
|
||||||
formatter.formatCoinWithCode(totalBalance), 10).second;
|
formatter.formatCoinWithCode(totalBalance), 10).second;
|
||||||
Tuple2<Label, InputTextField> tuple = addLabelInputTextField(gridPane, ++rowIndex, "Your destination address:");
|
Tuple2<Label, InputTextField> tuple = addLabelInputTextField(gridPane, ++rowIndex, "Your destination address:");
|
||||||
addressInputTextField = tuple.second;
|
addressInputTextField = tuple.second;
|
||||||
|
|
||||||
emptyWalletButton = new Button("Empty wallet");
|
emptyWalletButton = new Button("Empty wallet");
|
||||||
|
boolean isBalanceSufficient = Restrictions.isMinSpendableAmount(totalBalance);
|
||||||
emptyWalletButton.setDefaultButton(isBalanceSufficient);
|
emptyWalletButton.setDefaultButton(isBalanceSufficient);
|
||||||
|
closeButton.setDefaultButton(!isBalanceSufficient);
|
||||||
emptyWalletButton.setDisable(!isBalanceSufficient && addressInputTextField.getText().length() > 0);
|
emptyWalletButton.setDisable(!isBalanceSufficient && addressInputTextField.getText().length() > 0);
|
||||||
emptyWalletButton.setOnAction(e -> {
|
emptyWalletButton.setOnAction(e -> {
|
||||||
if (addressInputTextField.getText().length() > 0 && isBalanceSufficient) {
|
if (addressInputTextField.getText().length() > 0 && isBalanceSufficient) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue