Revert setting of deposit when cloning an offer

This commit is contained in:
Christoph Atteneder 2021-05-28 17:51:02 +02:00
parent 150ffc3b2b
commit b4520237b0
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B
2 changed files with 0 additions and 15 deletions

View File

@ -484,7 +484,6 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
if (dataModel.getAmount().get() != null) {
buyerSecurityDepositInBTC.set(btcFormatter.formatCoinWithCode(dataModel.getBuyerSecurityDepositAsCoin()));
}
updateBuyerSecurityDeposit();
} else {
buyerSecurityDeposit.set("");
buyerSecurityDepositInBTC.set("");

View File

@ -24,7 +24,6 @@ import bisq.desktop.main.offer.MutableOfferDataModel;
import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.btc.wallet.Restrictions;
import bisq.core.offer.CreateOfferService;
import bisq.core.offer.Offer;
import bisq.core.offer.OfferUtil;
@ -36,12 +35,9 @@ import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.coin.CoinUtil;
import bisq.network.p2p.P2PService;
import org.bitcoinj.core.Coin;
import com.google.inject.Inject;
import javax.inject.Named;
@ -90,18 +86,8 @@ class DuplicateOfferDataModel extends MutableOfferDataModel {
setVolume(offer.getVolume());
setUseMarketBasedPrice(offer.isUseMarketBasedPrice());
setBuyerSecurityDeposit(getBuyerSecurityAsPercent(offer));
if (offer.isUseMarketBasedPrice()) {
setMarketPriceMargin(offer.getMarketPriceMargin());
}
}
private double getBuyerSecurityAsPercent(Offer offer) {
Coin offerBuyerSecurityDeposit = getBoundedBuyerSecurityDepositAsCoin(offer.getBuyerSecurityDeposit());
double offerBuyerSecurityDepositAsPercent = CoinUtil.getAsPercentPerBtc(offerBuyerSecurityDeposit,
offer.getAmount());
return Math.min(offerBuyerSecurityDepositAsPercent,
Restrictions.getMaxBuyerSecurityDepositAsPercent());
}
}