From 629e1508f2251d7d2fccb94d06d72d0be4e0be0d Mon Sep 17 00:00:00 2001 From: woodser Date: Sat, 20 Jul 2024 21:41:20 -0400 Subject: [PATCH] do not request connection change on trade poll error except rescan --- core/src/main/java/haveno/core/trade/Trade.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/haveno/core/trade/Trade.java b/core/src/main/java/haveno/core/trade/Trade.java index 973cf7e2..0f629136 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -2546,7 +2546,12 @@ public abstract class Trade implements Tradable, Model { // rescan spent outputs to detect unconfirmed payout tx if (isPayoutExpected && wallet.getBalance().compareTo(BigInteger.ZERO) > 0) { - wallet.rescanSpent(); + try { + wallet.rescanSpent(); + } catch (Exception e) { + log.warn("Failed to rescan spent outputs for {} {}, errorMessage={}", getClass().getSimpleName(), getShortId(), e.getMessage()); + ThreadUtils.execute(() -> requestSwitchToNextBestConnection(), getId()); // do not block polling thread + } } // get txs from trade wallet @@ -2596,7 +2601,6 @@ public abstract class Trade implements Tradable, Model { boolean isWalletConnected = isWalletConnectedToDaemon(); if (wallet != null && !isShutDownStarted && isWalletConnected) { log.warn("Error polling trade wallet for {} {}, errorMessage={}. Monerod={}", getClass().getSimpleName(), getShortId(), e.getMessage(), getXmrWalletService().getConnectionService().getConnection()); - ThreadUtils.execute(() -> requestSwitchToNextBestConnection(), getId()); // do not block polling thread //e.printStackTrace(); } }