Skip to content

Commit

Permalink
Set amount for delayed payout tx to 0 (#3471)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chimp1984 authored and sqrrm committed Oct 27, 2019
1 parent 18c1333 commit a7a58da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit a7a58da

Please sign in to comment.