From d575f384ef9d1805b00fabb970e8f3c4d2bc8d21 Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Fri, 25 Jul 2025 17:45:14 -0400 Subject: [PATCH] skip connection switch on illegal error syncing wallet --- core/src/main/java/haveno/core/trade/Trade.java | 6 ++++-- 1 file changed, 4 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 faca3cf57e..6ec299592f 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -2596,7 +2596,7 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model { MoneroRpcConnection sourceConnection = xmrConnectionService.getConnection(); try { synchronized (walletLock) { - if (getWallet() == null) throw new RuntimeException("Cannot sync trade wallet because it doesn't exist for " + getClass().getSimpleName() + ", " + getId()); + if (getWallet() == null) throw new IllegalStateException("Cannot sync trade wallet because it doesn't exist for " + getClass().getSimpleName() + ", " + getId()); if (getWallet().getDaemonConnection() == null) throw new RuntimeException("Cannot sync trade wallet because it's not connected to a Monero daemon for " + getClass().getSimpleName() + ", " + getId()); if (isWalletBehind()) { log.info("Syncing wallet for {} {}", getClass().getSimpleName(), getShortId()); @@ -2616,7 +2616,9 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model { if (pollWallet) doPollWallet(); } catch (Exception e) { - if (!isShutDownStarted) ThreadUtils.execute(() -> requestSwitchToNextBestConnection(sourceConnection), getId()); + if (!(e instanceof IllegalStateException) && !isShutDownStarted) { + ThreadUtils.execute(() -> requestSwitchToNextBestConnection(sourceConnection), getId()); + } throw e; } }