From ed567beeb394c4396cd485313838260ab7a8f959 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 30 Oct 2024 09:18:39 -0400 Subject: [PATCH] add logging for dispute's trade being null #1364 --- core/src/main/java/haveno/core/trade/TradeManager.java | 1 + .../core/trade/protocol/tasks/ProcessDepositResponse.java | 1 + .../java/haveno/desktop/main/support/dispute/DisputeView.java | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/haveno/core/trade/TradeManager.java b/core/src/main/java/haveno/core/trade/TradeManager.java index 55acf63d..10db542e 100644 --- a/core/src/main/java/haveno/core/trade/TradeManager.java +++ b/core/src/main/java/haveno/core/trade/TradeManager.java @@ -958,6 +958,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi } public void unregisterTrade(Trade trade) { + log.warn("Unregistering {} {}", trade.getClass().getSimpleName(), trade.getId()); removeTrade(trade, true); removeFailedTrade(trade); requestPersistence(); diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositResponse.java b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositResponse.java index e37c6121..dcaf1a7e 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositResponse.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositResponse.java @@ -41,6 +41,7 @@ public class ProcessDepositResponse extends TradeTask { // throw if error DepositResponse message = (DepositResponse) processModel.getTradeMessage(); if (message.getErrorMessage() != null) { + log.warn("Unregistering trade {} {} because deposit response has error message={}", trade.getClass().getSimpleName(), trade.getShortId(), message.getErrorMessage()); trade.setStateIfValidTransitionTo(Trade.State.PUBLISH_DEPOSIT_TX_REQUEST_FAILED); processModel.getTradeManager().unregisterTrade(trade); throw new RuntimeException(message.getErrorMessage()); diff --git a/desktop/src/main/java/haveno/desktop/main/support/dispute/DisputeView.java b/desktop/src/main/java/haveno/desktop/main/support/dispute/DisputeView.java index 9d88ad23..f62761d4 100644 --- a/desktop/src/main/java/haveno/desktop/main/support/dispute/DisputeView.java +++ b/desktop/src/main/java/haveno/desktop/main/support/dispute/DisputeView.java @@ -1415,7 +1415,7 @@ public abstract class DisputeView extends ActivatableView implements private String getDisputeStateText(Dispute dispute) { Trade trade = tradeManager.getTrade(dispute.getTradeId()); if (trade == null) { - log.warn("Dispute's trade is null for trade {}", dispute.getTradeId()); + log.warn("Dispute's trade is null for trade {}, defaulting to dispute state text 'closed'", dispute.getTradeId()); return Res.get("support.closed"); } if (dispute.isClosed()) return Res.get("support.closed");