From 6ca775da1bebba57ca26b972b006b852c5d1b6c7 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 15 Jul 2022 18:23:54 -0400 Subject: [PATCH] reserve correct offer amount based on buy or sell direction --- core/src/main/java/bisq/core/offer/Offer.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/bisq/core/offer/Offer.java b/core/src/main/java/bisq/core/offer/Offer.java index 319125268b..ab90866a12 100644 --- a/core/src/main/java/bisq/core/offer/Offer.java +++ b/core/src/main/java/bisq/core/offer/Offer.java @@ -287,10 +287,8 @@ public class Offer implements NetworkPayload, PersistablePayload { // get the amount needed for the maker to reserve the offer public Coin getReserveAmount() { - Coin reserveAmount = getAmount(); - reserveAmount = reserveAmount.add(getDirection() == OfferDirection.BUY ? - getBuyerSecurityDeposit() : - getSellerSecurityDeposit()); + Coin reserveAmount = getDirection() == OfferDirection.BUY ? getBuyerSecurityDeposit() : getSellerSecurityDeposit(); + if (getDirection() == OfferDirection.SELL) reserveAmount = reserveAmount.add(getAmount()); return reserveAmount; }