mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Return correct security deposit percentage size when cloning an offer
This commit is contained in:
parent
993f9b4e29
commit
1ba42e0d91
@ -639,7 +639,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
||||
this.volume.set(volume);
|
||||
}
|
||||
|
||||
void setBuyerSecurityDeposit(double value) {
|
||||
protected void setBuyerSecurityDeposit(double value) {
|
||||
this.buyerSecurityDeposit.set(value);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ 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;
|
||||
@ -35,6 +36,7 @@ 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;
|
||||
|
||||
@ -84,7 +86,12 @@ class DuplicateOfferDataModel extends MutableOfferDataModel {
|
||||
setAmount(offer.getAmount());
|
||||
setPrice(offer.getPrice());
|
||||
setVolume(offer.getVolume());
|
||||
if (offer.getBuyerSecurityDeposit().value == Restrictions.getMinBuyerSecurityDepositAsCoin().getValue())
|
||||
setBuyerSecurityDeposit(Restrictions.getMinBuyerSecurityDepositAsPercent());
|
||||
else
|
||||
setBuyerSecurityDeposit(CoinUtil.getAsPercentPerBtc(offer.getBuyerSecurityDeposit(), offer.getAmount()));
|
||||
setUseMarketBasedPrice(offer.isUseMarketBasedPrice());
|
||||
|
||||
if (offer.isUseMarketBasedPrice()) {
|
||||
setMarketPriceMargin(offer.getMarketPriceMargin());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user