From 97f761bdf8714802c19742bebef0a01f204f7175 Mon Sep 17 00:00:00 2001 From: Steven Barclay Date: Sat, 28 Sep 2024 23:43:43 +0800 Subject: [PATCH] Make Transactions view tolerate missing tx witness data Make the filtering methods 'isPossible(RedirectOrClaimTx|EscrowSpend)', used to speed up the Transactions view, lenient towards segwit txs that have missing witness data. This appears to be the case for a lot of txs fetched from the network by bitcoinj, including all the segwit txs in the wallet after an SPV resync. Since the witness data of a peer's claim tx (picked up by bitcoinj) may in fact be missing, rename the field 'TradingPeer.signedClaimTx' to 'claimTx', along with corresponding proto field. Finally, make sure the correct details message is shown for refund agent payout txs, for v5 protocol trades in the Transactions view, by changing the order of some of the nested if-else branches, in order to avoid an unwanted '!trade.hasV5Protocol()' clause. --- .../bisq/core/trade/model/bisq_v1/Trade.java | 4 +-- .../protocol/bisq_v1/model/ProcessModel.java | 2 +- .../protocol/bisq_v1/model/TradingPeer.java | 6 ++--- .../bisq_v5/tasks/SetupStagedTxListeners.java | 2 +- .../TransactionAwareTradable.java | 9 +++++-- .../transactions/TransactionsListItem.java | 26 +++++++++---------- proto/src/main/proto/pb.proto | 2 +- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/model/bisq_v1/Trade.java b/core/src/main/java/bisq/core/trade/model/bisq_v1/Trade.java index a25e4ee809..3ec00753b5 100644 --- a/core/src/main/java/bisq/core/trade/model/bisq_v1/Trade.java +++ b/core/src/main/java/bisq/core/trade/model/bisq_v1/Trade.java @@ -720,8 +720,8 @@ public Transaction getClaimTx(BtcWalletService btcWalletService) { @Nullable public Transaction getPeersClaimTx(BtcWalletService btcWalletService) { - byte[] signedClaimTx = processModel.getTradePeer().getSignedClaimTx(); - return signedClaimTx != null ? btcWalletService.getTxFromSerializedTx(signedClaimTx) : null; + byte[] claimTx = processModel.getTradePeer().getClaimTx(); + return claimTx != null ? btcWalletService.getTxFromSerializedTx(claimTx) : null; } public List