mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Merge pull request #1287 from bisq-network/TradePeriodStartsAfterConfirmation
Start trading period after deposit transaction confirmation
This commit is contained in:
commit
8732aeab54
9 changed files with 77 additions and 65 deletions
|
@ -460,7 +460,7 @@ portfolio.pending.step5.completed=Completed
|
||||||
|
|
||||||
portfolio.pending.step1.info=Deposit transaction has been published.\n{0} need to wait for at least one blockchain confirmation before starting the payment.
|
portfolio.pending.step1.info=Deposit transaction has been published.\n{0} need to wait for at least one blockchain confirmation before starting the payment.
|
||||||
portfolio.pending.step1.warn=The deposit transaction still did not get confirmed.\nThat might happen in rare cases when the funding fee of one trader from the external wallet was too low.
|
portfolio.pending.step1.warn=The deposit transaction still did not get confirmed.\nThat might happen in rare cases when the funding fee of one trader from the external wallet was too low.
|
||||||
portfolio.pending.step1.openForDispute=The deposit transaction still did not get confirmed.\nThat might happen in rare cases when the funding fee of one trader from the external wallet was too low.\nThe max. period for the trade has elapsed.\n\nPlease contact the arbitrator for opening a dispute.
|
portfolio.pending.step1.openForDispute=The deposit transaction still did not get confirmed.\nThat might happen in rare cases when the funding fee of one trader from the external wallet was too low.\nThe max. period for the trade has elapsed.\n\nYou can wait longer or contact the arbitrator for opening a dispute.
|
||||||
|
|
||||||
# suppress inspection "TrailingSpacesInProperty"
|
# suppress inspection "TrailingSpacesInProperty"
|
||||||
portfolio.pending.step2.confReached=Your trade has reached at least one blockchain confirmation.\n(You can wait for more confirmations if you want - 6 confirmations are considered as very secure.)\n\n
|
portfolio.pending.step2.confReached=Your trade has reached at least one blockchain confirmation.\n(You can wait for more confirmations if you want - 6 confirmations are considered as very secure.)\n\n
|
||||||
|
@ -508,14 +508,14 @@ portfolio.pending.step2_buyer.confirmStart.yes=Yes, I have started the payment
|
||||||
portfolio.pending.step2_seller.waitPayment.headline=Wait for payment
|
portfolio.pending.step2_seller.waitPayment.headline=Wait for payment
|
||||||
portfolio.pending.step2_seller.waitPayment.msg=The deposit transaction has at least one blockchain confirmation.\nYou need to wait until the BTC buyer starts the {0} payment.
|
portfolio.pending.step2_seller.waitPayment.msg=The deposit transaction has at least one blockchain confirmation.\nYou need to wait until the BTC buyer starts the {0} payment.
|
||||||
portfolio.pending.step2_seller.warn=The BTC buyer still has not done the {0} payment.\nYou need to wait until he starts the payment.\nIf the trade has not been completed on {1} the arbitrator will investigate.
|
portfolio.pending.step2_seller.warn=The BTC buyer still has not done the {0} payment.\nYou need to wait until he starts the payment.\nIf the trade has not been completed on {1} the arbitrator will investigate.
|
||||||
portfolio.pending.step2_seller.openForDispute=The BTC buyer has not started his payment!\nThe max. allowed period for the trade has elapsed.\nPlease contact the arbitrator for opening a dispute.
|
portfolio.pending.step2_seller.openForDispute=The BTC buyer has not started his payment!\nThe max. allowed period for the trade has elapsed.\nYou can wait longer and give the trading peer more time or contact the arbitrator for opening a dispute.
|
||||||
|
|
||||||
portfolio.pending.step3_buyer.wait.headline=Wait for BTC seller's payment confirmation
|
portfolio.pending.step3_buyer.wait.headline=Wait for BTC seller's payment confirmation
|
||||||
portfolio.pending.step3_buyer.wait.info=Waiting for the BTC seller''s confirmation for the receipt of the {0} payment.
|
portfolio.pending.step3_buyer.wait.info=Waiting for the BTC seller''s confirmation for the receipt of the {0} payment.
|
||||||
portfolio.pending.step3_buyer.warn.part1a=on the {0} blockchain
|
portfolio.pending.step3_buyer.warn.part1a=on the {0} blockchain
|
||||||
portfolio.pending.step3_buyer.warn.part1b=at your payment provider (e.g. bank)
|
portfolio.pending.step3_buyer.warn.part1b=at your payment provider (e.g. bank)
|
||||||
portfolio.pending.step3_buyer.warn.part2=The BTC seller still has not confirmed your payment!\nPlease check {0} if the payment sending was successful.\nIf the BTC seller does not confirm the receipt of your payment by {1} the trade will be investigated by the arbitrator.
|
portfolio.pending.step3_buyer.warn.part2=The BTC seller still has not confirmed your payment!\nPlease check {0} if the payment sending was successful.\nIf the BTC seller does not confirm the receipt of your payment by {1} the trade will be investigated by the arbitrator.
|
||||||
portfolio.pending.step3_buyer.openForDispute=The BTC seller has not confirmed your payment!\nThe max. period for the trade has elapsed.\nPlease contact the arbitrator for opening a dispute.
|
portfolio.pending.step3_buyer.openForDispute=The BTC seller has not confirmed your payment!\nThe max. period for the trade has elapsed.\nYou can wait longer and give the trading peer more time or contact the arbitrator for opening a dispute.
|
||||||
# suppress inspection "TrailingSpacesInProperty"
|
# suppress inspection "TrailingSpacesInProperty"
|
||||||
portfolio.pending.step3_seller.part=Your trading partner has confirmed that he initiated the {0} payment.\n\n
|
portfolio.pending.step3_seller.part=Your trading partner has confirmed that he initiated the {0} payment.\n\n
|
||||||
portfolio.pending.step3_seller.altcoin={0}Please check on your favorite {1} blockchain explorer if the transaction to your receiving address\n\
|
portfolio.pending.step3_seller.altcoin={0}Please check on your favorite {1} blockchain explorer if the transaction to your receiving address\n\
|
||||||
|
@ -551,7 +551,7 @@ portfolio.pending.step3_seller.buyerStartedPayment.fiat=Check at your trading ac
|
||||||
portfolio.pending.step3_seller.warn.part1a=on the {0} blockchain
|
portfolio.pending.step3_seller.warn.part1a=on the {0} blockchain
|
||||||
portfolio.pending.step3_seller.warn.part1b=at your payment provider (e.g. bank)
|
portfolio.pending.step3_seller.warn.part1b=at your payment provider (e.g. bank)
|
||||||
portfolio.pending.step3_seller.warn.part2=You still have not confirmed the receipt of the payment!\nPlease check {0} if you have received the payment.\nIf you don''t confirm receipt by {1} the trade will be investigated by the arbitrator.
|
portfolio.pending.step3_seller.warn.part2=You still have not confirmed the receipt of the payment!\nPlease check {0} if you have received the payment.\nIf you don''t confirm receipt by {1} the trade will be investigated by the arbitrator.
|
||||||
portfolio.pending.step3_seller.openForDispute=You have not confirmed the receipt of the payment!\nThe max. period for the trade has elapsed.\nPlease contact the arbitrator for opening a dispute.
|
portfolio.pending.step3_seller.openForDispute=You have not confirmed the receipt of the payment!\nThe max. period for the trade has elapsed.\nPlease confirm or contact the arbitrator for opening a dispute.
|
||||||
# suppress inspection "TrailingSpacesInProperty"
|
# suppress inspection "TrailingSpacesInProperty"
|
||||||
portfolio.pending.step3_seller.onPaymentReceived.part1=Have you received the {0} payment from your trading partner?\n\n
|
portfolio.pending.step3_seller.onPaymentReceived.part1=Have you received the {0} payment from your trading partner?\n\n
|
||||||
# suppress inspection "TrailingSpacesInProperty"
|
# suppress inspection "TrailingSpacesInProperty"
|
||||||
|
|
|
@ -59,7 +59,7 @@ import static com.google.common.base.Preconditions.*;
|
||||||
// Does the basic wiring
|
// Does the basic wiring
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WalletConfig extends AbstractIdleService {
|
public class WalletConfig extends AbstractIdleService {
|
||||||
private static int TIMEOUT = 120 * 1000; // connectTimeoutMillis. 60 sec used in bitcoinj, but for Tor we allow more.
|
private static final int TIMEOUT = 120 * 1000; // connectTimeoutMillis. 60 sec used in bitcoinj, but for Tor we allow more.
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// WalletFactory
|
// WalletFactory
|
||||||
|
@ -220,6 +220,7 @@ public class WalletConfig extends AbstractIdleService {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true, the wallet will save itself to disk automatically whenever it changes.
|
* If true, the wallet will save itself to disk automatically whenever it changes.
|
||||||
*/
|
*/
|
||||||
|
@ -539,17 +540,14 @@ public class WalletConfig extends AbstractIdleService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void installShutdownHook() {
|
private void installShutdownHook() {
|
||||||
if (autoStop) Runtime.getRuntime().addShutdownHook(new Thread() {
|
if (autoStop) Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Thread.currentThread().setName("ShutdownHook");
|
Thread.currentThread().setName("ShutdownHook");
|
||||||
try {
|
try {
|
||||||
WalletConfig.this.stopAsync();
|
WalletConfig.this.stopAsync();
|
||||||
WalletConfig.this.awaitTerminated();
|
WalletConfig.this.awaitTerminated();
|
||||||
} catch (Throwable ignore) {
|
} catch (Throwable ignore) {
|
||||||
}
|
}
|
||||||
}
|
}));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.bitcoinj.core.Coin;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@EqualsAndHashCode(exclude = {"maxTradePeriod", "maxTradeLimit"})
|
@EqualsAndHashCode(exclude = {"maxTradePeriod", "maxTradeLimit"})
|
||||||
@ToString
|
@ToString
|
||||||
|
@ -40,8 +41,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// time in blocks (average 10 min for one block confirmation
|
// time in blocks (average 10 min for one block confirmation
|
||||||
private static final long HOUR = 3600_000;
|
private static final long DAY = TimeUnit.HOURS.toMillis(24);
|
||||||
private static final long DAY = HOUR * 24;
|
|
||||||
|
|
||||||
public static final String OK_PAY_ID = "OK_PAY";
|
public static final String OK_PAY_ID = "OK_PAY";
|
||||||
public static final String PERFECT_MONEY_ID = "PERFECT_MONEY";
|
public static final String PERFECT_MONEY_ID = "PERFECT_MONEY";
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
package io.bisq.core.trade;
|
package io.bisq.core.trade;
|
||||||
|
|
||||||
import com.google.common.base.Throwables;
|
|
||||||
import com.google.common.util.concurrent.FutureCallback;
|
import com.google.common.util.concurrent.FutureCallback;
|
||||||
import com.google.common.util.concurrent.Futures;
|
import com.google.common.util.concurrent.Futures;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
@ -329,15 +328,12 @@ public abstract class Trade implements Tradable, Model {
|
||||||
transient final private ObjectProperty<Phase> statePhaseProperty = new SimpleObjectProperty<>(state.phase);
|
transient final private ObjectProperty<Phase> statePhaseProperty = new SimpleObjectProperty<>(state.phase);
|
||||||
transient final private ObjectProperty<DisputeState> disputeStateProperty = new SimpleObjectProperty<>(disputeState);
|
transient final private ObjectProperty<DisputeState> disputeStateProperty = new SimpleObjectProperty<>(disputeState);
|
||||||
transient final private ObjectProperty<TradePeriodState> tradePeriodStateProperty = new SimpleObjectProperty<>(tradePeriodState);
|
transient final private ObjectProperty<TradePeriodState> tradePeriodStateProperty = new SimpleObjectProperty<>(tradePeriodState);
|
||||||
transient final private StringProperty errorMessageProperty = new SimpleStringProperty(errorMessage);
|
transient final private StringProperty errorMessageProperty = new SimpleStringProperty();
|
||||||
|
|
||||||
// Mutable
|
// Mutable
|
||||||
@Getter
|
@Getter
|
||||||
transient protected TradeProtocol tradeProtocol;
|
transient protected TradeProtocol tradeProtocol;
|
||||||
@Nullable
|
@Nullable
|
||||||
@Setter
|
|
||||||
transient private Date maxTradePeriodDate, halfTradePeriodDate;
|
|
||||||
@Nullable
|
|
||||||
transient private Transaction payoutTx;
|
transient private Transaction payoutTx;
|
||||||
@Nullable
|
@Nullable
|
||||||
transient private Transaction depositTx;
|
transient private Transaction depositTx;
|
||||||
|
@ -503,7 +499,7 @@ public abstract class Trade implements Tradable, Model {
|
||||||
// or async calls there.
|
// or async calls there.
|
||||||
// Clone to avoid ConcurrentModificationException. We remove items at the applyMailboxMessage call...
|
// Clone to avoid ConcurrentModificationException. We remove items at the applyMailboxMessage call...
|
||||||
HashSet<DecryptedMessageWithPubKey> set = new HashSet<>(decryptedMessageWithPubKeySet);
|
HashSet<DecryptedMessageWithPubKey> set = new HashSet<>(decryptedMessageWithPubKeySet);
|
||||||
set.stream().forEach(msg -> tradeProtocol.applyMailboxMessage(msg, this));
|
set.forEach(msg -> tradeProtocol.applyMailboxMessage(msg, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -690,20 +686,46 @@ public abstract class Trade implements Tradable, Model {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public Date getHalfTradePeriodDate() {
|
||||||
public Date getMaxTradePeriodDate() {
|
return new Date(getTradeStartTime() + getMaxTradePeriod() / 2);
|
||||||
if (maxTradePeriodDate == null && getTakeOfferDate() != null)
|
|
||||||
maxTradePeriodDate = new Date(getTakeOfferDate().getTime() + getOffer().getPaymentMethod().getMaxTradePeriod());
|
|
||||||
|
|
||||||
return maxTradePeriodDate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public Date getMaxTradePeriodDate() {
|
||||||
public Date getHalfTradePeriodDate() {
|
return new Date(getTradeStartTime() + getMaxTradePeriod());
|
||||||
if (halfTradePeriodDate == null && getTakeOfferDate() != null)
|
}
|
||||||
halfTradePeriodDate = new Date(getTakeOfferDate().getTime() + getOffer().getPaymentMethod().getMaxTradePeriod() / 2);
|
|
||||||
|
|
||||||
return halfTradePeriodDate;
|
private long getMaxTradePeriod() {
|
||||||
|
return getOffer().getPaymentMethod().getMaxTradePeriod();
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getTradeStartTime() {
|
||||||
|
final long now = System.currentTimeMillis();
|
||||||
|
long startTime;
|
||||||
|
final Transaction depositTx = getDepositTx();
|
||||||
|
if (depositTx != null && getTakeOfferDate() != null) {
|
||||||
|
if (depositTx.getConfidence().getDepthInBlocks() > 0) {
|
||||||
|
final long tradeTime = getTakeOfferDate().getTime();
|
||||||
|
long blockTime = depositTx.getUpdateTime().getTime();
|
||||||
|
// If block date is in future (Date in Bitcoin blocks can be off by +/- 2 hours) we use our current date.
|
||||||
|
// If block date is earlier than our trade date we use our trade date.
|
||||||
|
if (blockTime > now)
|
||||||
|
startTime = now;
|
||||||
|
else if (blockTime < tradeTime)
|
||||||
|
startTime = tradeTime;
|
||||||
|
else
|
||||||
|
startTime = blockTime;
|
||||||
|
|
||||||
|
log.debug("We set the start for the trade period to {}. Trade started at: {}. Block got mined at: {}",
|
||||||
|
new Date(startTime), new Date(tradeTime), new Date(blockTime));
|
||||||
|
} else {
|
||||||
|
log.debug("depositTx not confirmed yet. We don't start counting remaining trade period yet. txId={}", depositTx.getHashAsString());
|
||||||
|
startTime = now;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("depositTx is null");
|
||||||
|
startTime = now;
|
||||||
|
}
|
||||||
|
return startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasFailed() {
|
public boolean hasFailed() {
|
||||||
|
@ -863,7 +885,7 @@ public abstract class Trade implements Tradable, Model {
|
||||||
public void onFailure(@NotNull Throwable t) {
|
public void onFailure(@NotNull Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
log.error(t.getMessage());
|
log.error(t.getMessage());
|
||||||
Throwables.propagate(t);
|
throw new RuntimeException(t);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -916,8 +938,6 @@ public abstract class Trade implements Tradable, Model {
|
||||||
",\n tradePeriodStateProperty=" + tradePeriodStateProperty +
|
",\n tradePeriodStateProperty=" + tradePeriodStateProperty +
|
||||||
",\n errorMessageProperty=" + errorMessageProperty +
|
",\n errorMessageProperty=" + errorMessageProperty +
|
||||||
",\n tradeProtocol=" + tradeProtocol +
|
",\n tradeProtocol=" + tradeProtocol +
|
||||||
",\n maxTradePeriodDate=" + maxTradePeriodDate +
|
|
||||||
",\n halfTradePeriodDate=" + halfTradePeriodDate +
|
|
||||||
",\n payoutTx=" + payoutTx +
|
",\n payoutTx=" + payoutTx +
|
||||||
",\n depositTx=" + depositTx +
|
",\n depositTx=" + depositTx +
|
||||||
",\n tradeAmount=" + tradeAmount +
|
",\n tradeAmount=" + tradeAmount +
|
||||||
|
|
|
@ -829,7 +829,7 @@ public class MainViewModel implements ViewModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTradePeriodState() {
|
private void updateTradePeriodState() {
|
||||||
tradeManager.getTradableList().stream().forEach(trade -> {
|
tradeManager.getTradableList().forEach(trade -> {
|
||||||
if (!trade.isPayoutPublished()) {
|
if (!trade.isPayoutPublished()) {
|
||||||
Date maxTradePeriodDate = trade.getMaxTradePeriodDate();
|
Date maxTradePeriodDate = trade.getMaxTradePeriodDate();
|
||||||
Date halfTradePeriodDate = trade.getHalfTradePeriodDate();
|
Date halfTradePeriodDate = trade.getHalfTradePeriodDate();
|
||||||
|
|
|
@ -198,7 +198,7 @@ class CreateOfferViewModel extends ActivatableWithDataModel<CreateOfferDataModel
|
||||||
switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) {
|
switch (BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()) {
|
||||||
case "BTC":
|
case "BTC":
|
||||||
amount.set("0.0001");
|
amount.set("0.0001");
|
||||||
price.set("14029");
|
price.set("11029");
|
||||||
break;
|
break;
|
||||||
case "LTC":
|
case "LTC":
|
||||||
amount.set("50");
|
amount.set("50");
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
protected void activate() {
|
protected void activate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dont set own listener as we need to control the order of the calls
|
// Don't set own listener as we need to control the order of the calls
|
||||||
public void onSelectedItemChanged(PendingTradesListItem selectedItem) {
|
public void onSelectedItemChanged(PendingTradesListItem selectedItem) {
|
||||||
if (tradeStateSubscription != null) {
|
if (tradeStateSubscription != null) {
|
||||||
tradeStateSubscription.unsubscribe();
|
tradeStateSubscription.unsubscribe();
|
||||||
|
@ -156,30 +156,23 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
|
|
||||||
return btcFormatter.getCurrencyPair(item.getTrade().getOffer().getCurrencyCode());
|
return btcFormatter.getCurrencyPair(item.getTrade().getOffer().getCurrencyCode());
|
||||||
}
|
}
|
||||||
// trade period
|
|
||||||
|
|
||||||
private long getMaxTradePeriod() {
|
private long getMaxTradePeriod() {
|
||||||
return dataModel.getOffer() != null ? dataModel.getOffer().getPaymentMethod().getMaxTradePeriod() : 0;
|
return dataModel.getOffer() != null ? dataModel.getOffer().getPaymentMethod().getMaxTradePeriod() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getTimeWhenDisputeOpens() {
|
@Nullable
|
||||||
return dataModel.getTrade() != null ? dataModel.getTrade().getDate().getTime() + getMaxTradePeriod() : 0;
|
private Date getMaxTradePeriodDate() {
|
||||||
|
return dataModel.getTrade() != null ? dataModel.getTrade().getMaxTradePeriodDate() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getTimeWhenHalfPeriodReached() {
|
@Nullable
|
||||||
return dataModel.getTrade() != null ? dataModel.getTrade().getDate().getTime() + getMaxTradePeriod() / 2 : 0;
|
private Date getHalfTradePeriodDate() {
|
||||||
}
|
return dataModel.getTrade() != null ? dataModel.getTrade().getHalfTradePeriodDate() : null;
|
||||||
|
|
||||||
private Date getDateWhenDisputeOpens() {
|
|
||||||
return new Date(getTimeWhenDisputeOpens());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date getDateWhenHalfPeriodReached() {
|
|
||||||
return new Date(getTimeWhenHalfPeriodReached());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getRemainingTradeDuration() {
|
private long getRemainingTradeDuration() {
|
||||||
return getDateWhenDisputeOpens().getTime() - new Date().getTime();
|
return getMaxTradePeriodDate() != null ? getMaxTradePeriodDate().getTime() - new Date().getTime() : getMaxTradePeriod();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemainingTradeDurationAsWords() {
|
public String getRemainingTradeDurationAsWords() {
|
||||||
|
@ -200,11 +193,11 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showWarning() {
|
public boolean showWarning() {
|
||||||
return new Date().after(getDateWhenHalfPeriodReached());
|
return getHalfTradePeriodDate() != null && new Date().after(getHalfTradePeriodDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showDispute() {
|
public boolean showDispute() {
|
||||||
return new Date().after(getDateWhenDisputeOpens());
|
return getMaxTradePeriodDate() != null && new Date().after(getMaxTradePeriodDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -245,7 +238,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTxFee() {
|
public String getTxFee() {
|
||||||
if (trade != null) {
|
if (trade != null && trade.getTradeAmount() != null) {
|
||||||
Coin txFee = dataModel.getTxFee();
|
Coin txFee = dataModel.getTxFee();
|
||||||
String percentage = GUIUtil.getPercentageOfTradeAmount(txFee, trade.getTradeAmount(), btcFormatter);
|
String percentage = GUIUtil.getPercentageOfTradeAmount(txFee, trade.getTradeAmount(), btcFormatter);
|
||||||
return btcFormatter.formatCoinWithCode(txFee) + percentage;
|
return btcFormatter.formatCoinWithCode(txFee) + percentage;
|
||||||
|
@ -256,7 +249,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
|
|
||||||
public String getTradeFee() {
|
public String getTradeFee() {
|
||||||
if (trade != null && dataModel.getOffer() != null) {
|
if (trade != null && dataModel.getOffer() != null) {
|
||||||
if (dataModel.getOffer().isCurrencyForMakerFeeBtc()) {
|
if (dataModel.getOffer().isCurrencyForMakerFeeBtc() && trade.getTradeAmount() != null) {
|
||||||
Coin tradeFeeInBTC = dataModel.getTradeFeeInBTC();
|
Coin tradeFeeInBTC = dataModel.getTradeFeeInBTC();
|
||||||
String percentage = GUIUtil.getPercentageOfTradeAmount(tradeFeeInBTC, trade.getTradeAmount(), btcFormatter);
|
String percentage = GUIUtil.getPercentageOfTradeAmount(tradeFeeInBTC, trade.getTradeAmount(), btcFormatter);
|
||||||
return btcFormatter.formatCoinWithCode(tradeFeeInBTC) + percentage;
|
return btcFormatter.formatCoinWithCode(tradeFeeInBTC) + percentage;
|
||||||
|
@ -271,7 +264,7 @@ public class PendingTradesViewModel extends ActivatableWithDataModel<PendingTrad
|
||||||
public String getSecurityDeposit() {
|
public String getSecurityDeposit() {
|
||||||
Offer offer = dataModel.getOffer();
|
Offer offer = dataModel.getOffer();
|
||||||
Trade trade = dataModel.getTrade();
|
Trade trade = dataModel.getTrade();
|
||||||
if (offer != null && trade != null) {
|
if (offer != null && trade != null && trade.getTradeAmount() != null) {
|
||||||
Coin securityDeposit = dataModel.isBuyer() ?
|
Coin securityDeposit = dataModel.isBuyer() ?
|
||||||
offer.getBuyerSecurityDeposit()
|
offer.getBuyerSecurityDeposit()
|
||||||
: offer.getSellerSecurityDeposit();
|
: offer.getSellerSecurityDeposit();
|
||||||
|
|
|
@ -175,6 +175,7 @@ public abstract class TradeStepView extends AnchorPane {
|
||||||
else
|
else
|
||||||
txIdTextField.cleanup();
|
txIdTextField.cleanup();
|
||||||
|
|
||||||
|
if (model.dataModel.getTrade() != null)
|
||||||
PaymentMethodForm.addOpenTradeDuration(gridPane, ++gridRow, model.dataModel.getTrade().getOffer(),
|
PaymentMethodForm.addOpenTradeDuration(gridPane, ++gridRow, model.dataModel.getTrade().getOffer(),
|
||||||
model.getDateForOpenDispute());
|
model.getDateForOpenDispute());
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -99,7 +99,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.bisq-network.libdohj</groupId>
|
<groupId>com.github.bisq-network.libdohj</groupId>
|
||||||
<artifactId>libdohj-core</artifactId>
|
<artifactId>libdohj-core</artifactId>
|
||||||
<version>a83809f3</version>
|
<version>01ae7770</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.google.code.findbugs</groupId>
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
|
|
Loading…
Add table
Reference in a new issue