fix adjustment < min amount creating offers

This commit is contained in:
woodser 2023-10-30 09:17:51 -04:00
parent 4f5f82bf0f
commit f261a38cce
3 changed files with 10 additions and 11 deletions

View file

@ -524,6 +524,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel {
// if the volume != amount * price, we need to adjust the amount
if (amount.get() == null || !volumeBefore.equals(price.get().getVolumeByAmount(amount.get()))) {
BigInteger value = price.get().getAmountByVolume(volumeBefore);
value = value.max(Restrictions.getMinTradeAmount()); // adjust if below minimum
value = CoinUtil.getRoundedAmount(value, price.get(), getMaxTradeLimit(), tradeCurrencyCode.get(), paymentAccount.getPaymentMethod().getId());
amount.set(value);
}