diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java index 91506f00a11..966e54508b8 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java @@ -133,9 +133,9 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs protected boolean allowAmountUpdate = true; private final TradeStatisticsManager tradeStatisticsManager; - private final Predicate> isPositiveAmount = (c) -> c.get() != null && !c.get().isZero(); - private final Predicate> isPositivePrice = (p) -> p.get() != null && !p.get().isZero(); - private final Predicate> isPositiveVolume = (v) -> v.get() != null && !v.get().isZero(); + private final Predicate> isNonZeroAmount = (c) -> c.get() != null && !c.get().isZero(); + private final Predicate> isNonZeroPrice = (p) -> p.get() != null && !p.get().isZero(); + private final Predicate> isNonZeroVolume = (v) -> v.get() != null && !v.get().isZero(); /////////////////////////////////////////////////////////////////////////////////////////// // Constructor, lifecycle @@ -517,7 +517,7 @@ long getMaxTradeLimit() { } void calculateVolume() { - if (isPositivePrice.test(price) && isPositiveAmount.test(amount)) { + if (isNonZeroPrice.test(price) && isNonZeroAmount.test(amount)) { try { Volume volumeByAmount = calculateVolumeForAmount(amount); @@ -533,7 +533,7 @@ void calculateVolume() { } void calculateMinVolume() { - if (isPositivePrice.test(price) && isPositiveAmount.test(minAmount)) { + if (isNonZeroPrice.test(price) && isNonZeroAmount.test(minAmount)) { try { Volume volumeByAmount = calculateVolumeForAmount(minAmount); @@ -557,7 +557,7 @@ else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get())) } void calculateAmount() { - if (isPositivePrice.test(price) && isPositiveVolume.test(volume) && allowAmountUpdate) { + if (isNonZeroPrice.test(price) && isNonZeroVolume.test(volume) && allowAmountUpdate) { try { Coin value = DisplayUtils.reduceTo4Decimals(price.get().getAmountByVolume(volume.get()), btcFormatter); if (paymentAccount.isHalCashAccount())