diff --git a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java index 8eabd852eaa..b634f01a8d5 100644 --- a/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java +++ b/core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java @@ -414,16 +414,14 @@ private long getTradeLimit(Coin maxTradeLimit, AccountAgeWitness accountAgeWitness, AccountAge accountAgeCategory, OfferPayload.Direction direction, - PaymentMethod paymentMethod, - boolean isMyLimit) { + PaymentMethod paymentMethod) { if (CurrencyUtil.isCryptoCurrency(currencyCode) || !PaymentMethod.hasChargebackRisk(paymentMethod, currencyCode) || direction == OfferPayload.Direction.SELL) { return maxTradeLimit.value; } - long limit = isMyLimit ? OfferRestrictions.TOLERATED_SMALL_AMOUNT_SELF.value : - OfferRestrictions.TOLERATED_SMALL_AMOUNT_PEER.value; + long limit = OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value; var factor = signedBuyFactor(accountAgeCategory); if (factor > 0) { limit = MathUtils.roundDoubleToLong((double) maxTradeLimit.value * factor); @@ -511,8 +509,7 @@ public long getMyTradeLimit(PaymentAccount paymentAccount, String currencyCode, accountAgeWitness, accountAgeCategory, direction, - paymentAccount.getPaymentMethod(), - true); + paymentAccount.getPaymentMethod()); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -574,14 +571,14 @@ public boolean verifyPeersTradeAmount(Offer offer, checkNotNull(offer); // In case we don't find the witness we check if the trade amount is above the - // TOLERATED_SMALL_AMOUNT_PEER and only in that case return false. + // TOLERATED_SMALL_TRADE_AMOUNT (0.01 BTC) and only in that case return false. return findWitness(offer) .map(witness -> verifyPeersTradeLimit(offer, tradeAmount, witness, new Date(), errorMessageHandler)) - .orElse(isPeerToleratedSmallAmount(tradeAmount)); + .orElse(isToleratedSmalleAmount(tradeAmount)); } - private boolean isPeerToleratedSmallAmount(Coin tradeAmount) { - return tradeAmount.value <= OfferRestrictions.TOLERATED_SMALL_AMOUNT_PEER.value; + private boolean isToleratedSmalleAmount(Coin tradeAmount) { + return tradeAmount.value <= OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value; } @@ -645,7 +642,7 @@ private boolean verifyPeersTradeLimit(Offer offer, OfferPayload.Direction direction = offer.isMyOffer(keyRing) ? offer.getMirroredDirection() : offer.getDirection(); peersCurrentTradeLimit = getTradeLimit(defaultMaxTradeLimit, currencyCode, peersWitness, - accountAgeCategory, direction, offer.getPaymentMethod(), false); + accountAgeCategory, direction, offer.getPaymentMethod()); } // Makers current trade limit cannot be smaller than that in the offer boolean result = tradeAmount.value <= peersCurrentTradeLimit; diff --git a/core/src/main/java/bisq/core/offer/OfferRestrictions.java b/core/src/main/java/bisq/core/offer/OfferRestrictions.java index c052c5bc4fe..856b7a6e206 100644 --- a/core/src/main/java/bisq/core/offer/OfferRestrictions.java +++ b/core/src/main/java/bisq/core/offer/OfferRestrictions.java @@ -36,11 +36,7 @@ static boolean requiresUpdate() { return new Date().after(REQUIRE_UPDATE_DATE); } - // These values should generally be the same. However, to avoid voiding offers created with a higher limit - // the TOLERATED_SMALL_AMOUNT_PEER value can be set to the higher limit to allow those offers to be taken - // for a while. - public static Coin TOLERATED_SMALL_AMOUNT_SELF = Coin.parseCoin("0.0025"); - public static Coin TOLERATED_SMALL_AMOUNT_PEER = Coin.parseCoin("0.01"); + public static Coin TOLERATED_SMALL_TRADE_AMOUNT = Coin.parseCoin("0.01"); static boolean hasOfferMandatoryCapability(Offer offer, Capability mandatoryCapability) { Map extraDataMap = offer.getOfferPayload().getExtraDataMap(); diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java index 44a9d9e601c..7330a398de9 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java @@ -66,7 +66,6 @@ import bisq.desktop.util.validation.IBANValidator; import bisq.desktop.util.validation.InteracETransferValidator; import bisq.desktop.util.validation.JapanBankTransferValidator; -import bisq.desktop.util.validation.LengthValidator; import bisq.desktop.util.validation.MoneyBeamValidator; import bisq.desktop.util.validation.PerfectMoneyValidator; import bisq.desktop.util.validation.PopmoneyValidator; @@ -77,6 +76,7 @@ import bisq.desktop.util.validation.USPostalMoneyOrderValidator; import bisq.desktop.util.validation.UpholdValidator; import bisq.desktop.util.validation.WeChatPayValidator; +import bisq.desktop.util.validation.LengthValidator; import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.locale.Res; @@ -271,7 +271,7 @@ private void onSaveNewAccount(PaymentAccount paymentAccount) { if (PaymentMethod.hasChargebackRisk(paymentAccount.getPaymentMethod(), paymentAccount.getTradeCurrencies())) { limitsInfoKey = "payment.limits.info.withSigning"; - initialLimit = formatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_AMOUNT_SELF); + initialLimit = formatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT); } new Popup().information(Res.get(limitsInfoKey, diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java index 9db55b447ee..4c60ca72203 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java @@ -724,10 +724,10 @@ void onFocusOutAmountTextField(boolean oldValue, boolean newValue) { if (minAmount.get() != null) minAmountValidationResult.set(isBtcInputValid(minAmount.get())); - } else if (amount.get() != null && btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_AMOUNT_SELF.value) { + } else if (amount.get() != null && btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) { amount.set(btcFormatter.formatCoin(btcValidator.getMaxTradeLimit())); new Popup().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.buyer", - btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_AMOUNT_SELF), + btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), Res.get("offerbook.warning.newVersionAnnouncement"))) .width(900) .show(); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java index df2bcf1169a..14c78bf5b91 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java @@ -1117,7 +1117,7 @@ private AutoTooltipTableColumn getSigningS Res.get("offerbook.timeSinceSigning"), Res.get("offerbook.timeSinceSigning.help", SignedWitnessService.SIGNER_AGE_DAYS, - formatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_AMOUNT_PEER))) { + formatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT))) { { setMinWidth(60); setSortable(true); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java index 40c1f1e606a..043db5af5d9 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java @@ -346,16 +346,16 @@ void onFocusOutAmountTextField(boolean oldValue, boolean newValue, String userIn if (dataModel.wouldCreateDustForMaker()) amountValidationResult.set(new InputValidator.ValidationResult(false, Res.get("takeOffer.validation.amountLargerThanOfferAmountMinusFee"))); - } else if (btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_AMOUNT_PEER.value) { + } else if (btcValidator.getMaxTradeLimit() != null && btcValidator.getMaxTradeLimit().value == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value) { if (dataModel.getDirection() == OfferPayload.Direction.BUY) { new Popup().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.seller", - btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_AMOUNT_PEER), + btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), Res.get("offerbook.warning.newVersionAnnouncement"))) .width(900) .show(); } else { new Popup().information(Res.get("popup.warning.tradeLimitDueAccountAgeRestriction.buyer", - btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_AMOUNT_PEER), + btcFormatter.formatCoinWithCode(OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT), Res.get("offerbook.warning.newVersionAnnouncement"))) .width(900) .show();