mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Add try/catch at setSuggestedSecurityDeposit code
This commit is contained in:
parent
efcca92688
commit
601de7890d
1 changed files with 34 additions and 29 deletions
|
@ -335,6 +335,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
|||
|
||||
private void setSuggestedSecurityDeposit(PaymentAccount paymentAccount) {
|
||||
var minSecurityDeposit = preferences.getBuyerSecurityDepositAsPercent(getPaymentAccount());
|
||||
try {
|
||||
if (getTradeCurrency() == null) {
|
||||
setBuyerSecurityDeposit(minSecurityDeposit, false);
|
||||
return;
|
||||
|
@ -366,6 +367,10 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
|||
var suggestedSecurityDeposit =
|
||||
Math.min(2 * (max - min) / max, Restrictions.getMaxBuyerSecurityDepositAsPercent());
|
||||
buyerSecurityDeposit.set(Math.max(suggestedSecurityDeposit, minSecurityDeposit));
|
||||
} catch (Throwable t) {
|
||||
log.error(t.toString());
|
||||
buyerSecurityDeposit.set(minSecurityDeposit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue