From 77cf67e6f00b47a9cff576fd1048223a53ddd395 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 8 Sep 2023 13:04:30 -0400 Subject: [PATCH] start polling for best connection after delay --- .../haveno/core/api/CoreMoneroConnectionsService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/haveno/core/api/CoreMoneroConnectionsService.java b/core/src/main/java/haveno/core/api/CoreMoneroConnectionsService.java index 4e1fdac2..3390867d 100644 --- a/core/src/main/java/haveno/core/api/CoreMoneroConnectionsService.java +++ b/core/src/main/java/haveno/core/api/CoreMoneroConnectionsService.java @@ -1,5 +1,6 @@ package haveno.core.api; +import haveno.common.UserThread; import haveno.common.app.DevEnv; import haveno.common.config.Config; import haveno.core.trade.HavenoUtils; @@ -469,6 +470,13 @@ public final class CoreMoneroConnectionsService { // register connection listener connectionManager.addListener(this::onConnectionChanged); + // start polling for best connection after delay + if ("".equals(config.xmrNode)) { + UserThread.runAfter(() -> { + if (!isShutDownStarted) connectionManager.startPolling(getRefreshPeriodMs() * 2); + }, getDefaultRefreshPeriodMs() * 2 / 1000); + } + // notify final connection isInitialized = true; onConnectionChanged(connectionManager.getConnection());