Skip to content

Commit

Permalink
Revert setting of deposit when cloning an offer
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx committed May 28, 2021
1 parent 84c3fb5 commit caec38d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ private void createListeners() {
if (dataModel.getAmount().get() != null) {
buyerSecurityDepositInBTC.set(btcFormatter.formatCoinWithCode(dataModel.getBuyerSecurityDepositAsCoin()));
}
updateBuyerSecurityDeposit();
} else {
buyerSecurityDeposit.set("");
buyerSecurityDepositInBTC.set("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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;
Expand All @@ -36,12 +35,9 @@
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;
Expand Down Expand Up @@ -90,18 +86,8 @@ public void populateData(Offer offer) {
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());
}
}

0 comments on commit caec38d

Please sign in to comment.