From 291622e4529c6fec3198226b210a69eb15c0da6d Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 19 Jul 2024 08:47:33 -0400 Subject: [PATCH] switch to current connection on connection changed --- core/src/main/java/haveno/core/trade/Trade.java | 3 +++ .../main/java/haveno/core/xmr/wallet/XmrWalletService.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/core/src/main/java/haveno/core/trade/Trade.java b/core/src/main/java/haveno/core/trade/Trade.java index afa7579209..efb62c39e8 100644 --- a/core/src/main/java/haveno/core/trade/Trade.java +++ b/core/src/main/java/haveno/core/trade/Trade.java @@ -2323,6 +2323,9 @@ public abstract class Trade implements Tradable, Model { private void onConnectionChanged(MoneroRpcConnection connection) { synchronized (walletLock) { + // use current connection + connection = xmrConnectionService.getConnection(); + // check if ignored if (isShutDownStarted) return; if (getWallet() == null) return; diff --git a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java index aa44226555..f838c92beb 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -1660,6 +1660,11 @@ public class XmrWalletService { private void onConnectionChanged(MoneroRpcConnection connection) { synchronized (WALLET_LOCK) { + + // use current connection + connection = xmrConnectionService.getConnection(); + + // check if ignored if (wallet == null || isShutDownStarted) return; if (HavenoUtils.connectionConfigsEqual(connection, wallet.getDaemonConnection())) return; String oldProxyUri = wallet == null || wallet.getDaemonConnection() == null ? null : wallet.getDaemonConnection().getProxyUri();