From a7a58da978466bdd522c1fd8d527be92d4ae411b Mon Sep 17 00:00:00 2001 From: chimp1984 <54558767+chimp1984@users.noreply.github.com> Date: Sun, 27 Oct 2019 11:32:03 -0500 Subject: [PATCH] Set amount for delayed payout tx to 0 (#3471) We have shown the spent funds from the deposit tx to the bisq donation address before. But that was incorrect from the wallet perspective and would have lead to incorrect summary of all transaction amounts. We set it now to 0 as we are not spending funds nor receiving any in our wallet. --- .../resources/i18n/displayStrings.properties | 2 +- .../transactions/TransactionsListItem.java | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index b9c727b0c26..267c0543170 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -900,7 +900,7 @@ funds.tx.multiSigDeposit=Multisig deposit: {0} funds.tx.multiSigPayout=Multisig payout: {0} funds.tx.disputePayout=Dispute payout: {0} funds.tx.disputeLost=Lost dispute case: {0} -funds.tx.collateralForRefund=Collateral for refund: {0} +funds.tx.collateralForRefund=Refund collateral: {0} funds.tx.timeLockedPayoutTx=Time locked payout tx: {0} funds.tx.refund=Refund from arbitration: {0} funds.tx.unknown=Unknown reason: {0} diff --git a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java index 09e6b349be3..2dab2c11a93 100644 --- a/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java +++ b/desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionsListItem.java @@ -30,7 +30,6 @@ import bisq.core.locale.Res; import bisq.core.offer.Offer; import bisq.core.offer.OpenOffer; -import bisq.core.trade.Contract; import bisq.core.trade.Tradable; import bisq.core.trade.Trade; import bisq.core.util.BSFormatter; @@ -239,15 +238,14 @@ public void onTransactionConfidenceChanged(TransactionConfidence confidence) { if (valueSentToMe.isPositive()) { details = Res.get("funds.tx.refund", tradeId); } else { - Contract contract = trade.getContract(); - Coin tradeAmount = trade.getTradeAmount(); - if (contract != null && tradeAmount != null) { - boolean isBuyer = contract.isMyRoleBuyer(pubKeyRing); - amountAsCoin = isBuyer ? trade.getOffer().getBuyerSecurityDeposit().multiply(-1) : - (trade.getOffer().getSellerSecurityDeposit().add(tradeAmount)).multiply(-1); - details = Res.get("funds.tx.collateralForRefund", tradeId); - txConfidenceIndicator.setVisible(false); - } + // We have spent the deposit tx outputs to the Bisq donation address to enable + // the refund process (refund agent -> reimbursement). As the funds have left our wallet + // already when funding the deposit tx we show 0 BTC as amount. + // Confirmation is not known from the BitcoinJ side (not 100% clear why) as no funds + // left our wallet nor we received funds. So we set indicator invisible. + amountAsCoin = Coin.ZERO; + details = Res.get("funds.tx.collateralForRefund", tradeId); + txConfidenceIndicator.setVisible(false); } } else { if (transactionAwareTrade.isDelayedPayoutTx(txId)) {