Skip to content

Commit d948ca7

Browse files
committed
skip connection switch on illegal error syncing wallet
1 parent 583b0dd commit d948ca7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/haveno/core/trade/Trade.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,7 @@ private void syncWallet(boolean pollWallet) {
25812581
MoneroRpcConnection sourceConnection = xmrConnectionService.getConnection();
25822582
try {
25832583
synchronized (walletLock) {
2584-
if (getWallet() == null) throw new RuntimeException("Cannot sync trade wallet because it doesn't exist for " + getClass().getSimpleName() + ", " + getId());
2584+
if (getWallet() == null) throw new IllegalStateException("Cannot sync trade wallet because it doesn't exist for " + getClass().getSimpleName() + ", " + getId());
25852585
if (getWallet().getDaemonConnection() == null) throw new RuntimeException("Cannot sync trade wallet because it's not connected to a Monero daemon for " + getClass().getSimpleName() + ", " + getId());
25862586
if (isWalletBehind()) {
25872587
log.info("Syncing wallet for {} {}", getClass().getSimpleName(), getShortId());
@@ -2601,7 +2601,9 @@ private void syncWallet(boolean pollWallet) {
26012601

26022602
if (pollWallet) doPollWallet();
26032603
} catch (Exception e) {
2604-
if (!isShutDownStarted) ThreadUtils.execute(() -> requestSwitchToNextBestConnection(sourceConnection), getId());
2604+
if (!(e instanceof IllegalStateException) && !isShutDownStarted) {
2605+
ThreadUtils.execute(() -> requestSwitchToNextBestConnection(sourceConnection), getId());
2606+
}
26052607
throw e;
26062608
}
26072609
}

0 commit comments

Comments
 (0)