From ee3e4fb383e3a53cb3c824c680d146664b6166ff Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 27 Jul 2023 09:48:39 -0400 Subject: [PATCH] reduce monerod requests in transactions view by checking id equality --- .../transactions/TransactionAwareTrade.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionAwareTrade.java b/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionAwareTrade.java index b9d1fdf9..1b0151a4 100644 --- a/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionAwareTrade.java +++ b/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionAwareTrade.java @@ -27,7 +27,6 @@ import haveno.core.trade.Trade; import haveno.core.xmr.wallet.XmrWalletService; import javafx.collections.ObservableList; import lombok.extern.slf4j.Slf4j; -import monero.daemon.model.MoneroTx; import monero.wallet.model.MoneroTxWallet; import java.util.Optional; @@ -68,24 +67,15 @@ class TransactionAwareTrade implements TransactionAwareTradable { } private boolean isPayoutTx(String txId) { - return Optional.ofNullable(trade.getPayoutTx()) - .map(MoneroTx::getHash) - .map(hash -> hash.equals(txId)) - .orElse(false); + return txId.equals(trade.getPayoutTxId()); } private boolean isMakerDepositTx(String txId) { - return Optional.ofNullable(trade.getMakerDepositTx()) - .map(MoneroTx::getHash) - .map(hash -> hash.equals(txId)) - .orElse(false); + return txId.equals(trade.getMaker().getDepositTxHash()); } private boolean isTakerDepositTx(String txId) { - return Optional.ofNullable(trade.getTakerDepositTx()) - .map(MoneroTx::getHash) - .map(hash -> hash.equals(txId)) - .orElse(false); + return txId.equals(trade.getTaker().getDepositTxHash()); } private boolean isOfferFeeTx(String txId) {