Fix wrong default tx size for taker

This commit is contained in:
Manfred Karrer 2018-01-10 14:09:04 +01:00
parent 391844e41e
commit 077c2d68ed
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
2 changed files with 7 additions and 6 deletions

View File

@ -193,8 +193,8 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
UserThread.runAfter(() -> {
switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) {
case "BTC":
amount.set("0.1");
price.set("0.0001");
amount.set("0.0001");
price.set("13850");
break;
case "LTC":
amount.set("50");

View File

@ -103,7 +103,8 @@ class TakeOfferDataModel extends ActivatableDataModel {
Coin totalAvailableBalance;
private Notification walletFundedNotification;
Price tradePrice;
private int feeTxSize = 320; // 260 kb is size of typical trade fee tx with 1 input but trade tx (deposit and payout) are larger so we adjust to 320
// 260 kb is size of typical trade fee tx with 1 input but trade tx (deposit and payout) are larger so we adjust to 320
private int feeTxSize = 320;
private int feeTxSizeEstimationRecursionCounter;
@ -349,10 +350,10 @@ class TakeOfferDataModel extends ActivatableDataModel {
txFeeFromFeeService.toFriendlyString(), feeService.getTxFeePerByte());
}
} catch (InsufficientMoneyException e) {
// If we need to fund from an external wallet we can assume we only have 1 input (260 bytes).
// If we need to fund from an external wallet we can assume we only have 1 input (320 bytes).
log.warn("We cannot do the fee estimation because there are not enough funds in the wallet. This is expected " +
"if the user pays from an external wallet. In that case we use an estimated tx size of 260 bytes.");
feeTxSize = 260;
"if the user pays from an external wallet. In that case we use an estimated tx size of 320 bytes.");
feeTxSize = 320;
txFeeFromFeeService = feeService.getTxFee(feeTxSize);
log.info("feeTxSize {} bytes", feeTxSize);
log.info("txFee based on estimated size: {}, recommended txFee is {} sat/byte",