From ce68f2e24a162e51eb59fbb5fbcaefb40fc9d84f Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 8 Dec 2020 17:11:58 -0500 Subject: [PATCH] Check also for depositTxId in trade and check if both txId and tx.getId are the same. We got some reports where users have no deposit tx displayed in the trade after spv resync but cannot move the trade to failed trades. It seems the invalid txId is still stored in the trade but the tx itself got removed from the wallet after reysnc. We check not that both the tx and the txId need to be present. --- core/src/main/java/bisq/core/trade/Trade.java | 1 + .../main/overlays/windows/TradeDetailsWindow.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/Trade.java b/core/src/main/java/bisq/core/trade/Trade.java index ba503622629..1305e095ca2 100644 --- a/core/src/main/java/bisq/core/trade/Trade.java +++ b/core/src/main/java/bisq/core/trade/Trade.java @@ -1030,6 +1030,7 @@ public boolean isTxChainInvalid() { return offer.getOfferFeePaymentTxId() == null || getTakerFeeTxId() == null || getDepositTxId() == null || + getDepositTx() == null || getDelayedPayoutTxBytes() == null; } diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java index 494dad9d02c..e462af0f280 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/TradeDetailsWindow.java @@ -19,6 +19,7 @@ import bisq.desktop.components.BisqTextArea; import bisq.desktop.components.TextFieldWithCopyIcon; +import bisq.desktop.components.TxIdTextField; import bisq.desktop.main.MainView; import bisq.desktop.main.overlays.Overlay; import bisq.desktop.util.DisplayUtils; @@ -285,9 +286,17 @@ private void addContent() { addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerFeeTxId"), offer.getOfferFeePaymentTxId()); addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerFeeTxId"), trade.getTakerFeeTxId()); + String depositTxId = trade.getDepositTxId(); Transaction depositTx = trade.getDepositTx(); - String depositTxString = depositTx != null ? depositTx.getTxId().toString() : null; - addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.depositTransactionId"), depositTxString); + String depositTxIdFromTx = depositTx != null ? depositTx.getTxId().toString() : null; + TxIdTextField depositTxIdTextField = addLabelTxIdTextField(gridPane, ++rowIndex, + Res.get("shared.depositTransactionId"), depositTxId).second; + if (depositTxId == null || !depositTxId.equals(depositTxIdFromTx)) { + depositTxIdTextField.getTextField().setId("address-text-field-error"); + log.error("trade.getDepositTxId() and trade.getDepositTx().getTxId().toString() are not the same. " + + "trade.getDepositTxId()={}, trade.getDepositTx().getTxId().toString()={}, depositTx={}", + depositTxId, depositTxIdFromTx, depositTx); + } Transaction delayedPayoutTx = trade.getDelayedPayoutTx(btcWalletService); String delayedPayoutTxString = delayedPayoutTx != null ? delayedPayoutTx.getTxId().toString() : null;