Skip to content

Commit

Permalink
Merge pull request #4921 from chimp1984/add-move-to-failed-trades-but…
Browse files Browse the repository at this point in the history
…ton-if-deposit-tx-is-missing

Detect missing deposit tx to allow moving to failed trades
  • Loading branch information
ripcurlx authored Dec 9, 2020
2 parents a340a83 + ce68f2e commit d65e0b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/src/main/java/bisq/core/trade/Trade.java
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ public boolean isTxChainInvalid() {
return offer.getOfferFeePaymentTxId() == null ||
getTakerFeeTxId() == null ||
getDepositTxId() == null ||
getDepositTx() == null ||
getDelayedPayoutTxBytes() == null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d65e0b5

Please sign in to comment.