Skip to content

Commit

Permalink
Merge pull request #4345 from jmacxx/fix_offer_fee_changed
Browse files Browse the repository at this point in the history
Create order using the same tx fee specified at funding
  • Loading branch information
sqrrm authored Jul 3, 2020
2 parents 149cf13 + f3fa5ad commit ac2f37f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/src/main/java/bisq/core/grpc/CoreOffersService.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ public void createOffer(String offerId,
PaymentAccount paymentAccount,
boolean useSavingsWallet,
TransactionResultHandler resultHandler) {
Coin useDefaultTxFee = Coin.ZERO;
Offer offer = createOfferService.createAndGetOffer(offerId,
direction,
currencyCode,
amount,
minAmount,
price,
useDefaultTxFee,
useMarketBasedPrice,
marketPriceMargin,
buyerSecurityDeposit,
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/bisq/core/offer/CreateOfferService.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public Offer createAndGetOffer(String offerId,
Coin amount,
Coin minAmount,
Price price,
Coin txFee,
boolean useMarketBasedPrice,
double marketPriceMargin,
double buyerSecurityDepositAsDouble,
Expand Down Expand Up @@ -183,6 +184,7 @@ public Offer createAndGetOffer(String offerId,
List<String> acceptedBanks = PaymentAccountUtil.getAcceptedBanks(paymentAccount);
double sellerSecurityDeposit = getSellerSecurityDepositAsDouble();
Coin txFeeFromFeeService = getEstimatedFeeAndTxSize(amount, direction, buyerSecurityDepositAsDouble, sellerSecurityDeposit).first;
Coin txFeeToUse = txFee.isPositive() ? txFee : txFeeFromFeeService;
Coin makerFeeAsCoin = getMakerFee(amount);
boolean isCurrencyForMakerFeeBtc = OfferUtil.isCurrencyForMakerFeeBtc(preferences, bsqWalletService, amount);
Coin buyerSecurityDepositAsCoin = getBuyerSecurityDeposit(amount, buyerSecurityDepositAsDouble);
Expand Down Expand Up @@ -233,7 +235,7 @@ public Offer createAndGetOffer(String offerId,
acceptedBanks,
Version.VERSION,
btcWalletService.getLastBlockSeenHeight(),
txFeeFromFeeService.value,
txFeeToUse.value,
makerFeeAsCoin.value,
isCurrencyForMakerFeeBtc,
buyerSecurityDepositAsCoin.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ Offer createAndGetOffer() {
amount.get(),
minAmount.get(),
price.get(),
txFeeFromFeeService,
useMarketBasedPrice.get(),
marketPriceMargin,
buyerSecurityDeposit.get(),
Expand Down

0 comments on commit ac2f37f

Please sign in to comment.