Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create offer using the same tx fee specified at funding #4345

Merged
merged 1 commit into from Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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