mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-23 04:29:22 +00:00
fix amount adjustment above maximum limit
This commit is contained in:
parent
9d5ea3db4c
commit
5f0cce492e
1 changed files with 1 additions and 0 deletions
|
@ -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.min(BigInteger.valueOf(getMaxTradeLimit())); // adjust if above maximum
|
||||
value = value.max(Restrictions.getMinTradeAmount()); // adjust if below minimum
|
||||
value = CoinUtil.getRoundedAmount(value, price.get(), getMaxTradeLimit(), tradeCurrencyCode.get(), paymentAccount.getPaymentMethod().getId());
|
||||
amount.set(value);
|
||||
|
|
Loading…
Reference in a new issue