mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Create order using the same tx fee specified at funding
This fixes an issue whereby updates from the fee API were causing Insufficient Funds exception. Since the wallet is funded with a specific amount (deposit+trade fee+txFee), that same amount has to be used when the user confirms offer creation (which could be some time later). Fixes #4227 Fixes #4278 Fixes #4336 Fixes #4327
This commit is contained in:
parent
a54eeeabcc
commit
f3fa5ad3a1
@ -123,12 +123,14 @@ public class CoreOffersService {
|
||||
PaymentAccount paymentAccount,
|
||||
boolean useSavingsWallet,
|
||||
TransactionResultHandler resultHandler) {
|
||||
Coin useDefaultTxFee = Coin.ZERO;
|
||||
Offer offer = createOfferService.createAndGetOffer(offerId,
|
||||
direction,
|
||||
currencyCode,
|
||||
amount,
|
||||
minAmount,
|
||||
price,
|
||||
useDefaultTxFee,
|
||||
useMarketBasedPrice,
|
||||
marketPriceMargin,
|
||||
buyerSecurityDeposit,
|
||||
|
@ -124,6 +124,7 @@ public class CreateOfferService {
|
||||
Coin amount,
|
||||
Coin minAmount,
|
||||
Price price,
|
||||
Coin txFee,
|
||||
boolean useMarketBasedPrice,
|
||||
double marketPriceMargin,
|
||||
double buyerSecurityDepositAsDouble,
|
||||
@ -183,6 +184,7 @@ public class CreateOfferService {
|
||||
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);
|
||||
@ -233,7 +235,7 @@ public class CreateOfferService {
|
||||
acceptedBanks,
|
||||
Version.VERSION,
|
||||
btcWalletService.getLastBlockSeenHeight(),
|
||||
txFeeFromFeeService.value,
|
||||
txFeeToUse.value,
|
||||
makerFeeAsCoin.value,
|
||||
isCurrencyForMakerFeeBtc,
|
||||
buyerSecurityDepositAsCoin.value,
|
||||
|
@ -282,6 +282,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
||||
amount.get(),
|
||||
minAmount.get(),
|
||||
price.get(),
|
||||
txFeeFromFeeService,
|
||||
useMarketBasedPrice.get(),
|
||||
marketPriceMargin,
|
||||
buyerSecurityDeposit.get(),
|
||||
|
Loading…
Reference in New Issue
Block a user