mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-03 17:40:10 +00:00
start polling for best connection after delay
This commit is contained in:
parent
da9b251f12
commit
77cf67e6f0
1 changed files with 8 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package haveno.core.api;
|
package haveno.core.api;
|
||||||
|
|
||||||
|
import haveno.common.UserThread;
|
||||||
import haveno.common.app.DevEnv;
|
import haveno.common.app.DevEnv;
|
||||||
import haveno.common.config.Config;
|
import haveno.common.config.Config;
|
||||||
import haveno.core.trade.HavenoUtils;
|
import haveno.core.trade.HavenoUtils;
|
||||||
|
@ -469,6 +470,13 @@ public final class CoreMoneroConnectionsService {
|
||||||
// register connection listener
|
// register connection listener
|
||||||
connectionManager.addListener(this::onConnectionChanged);
|
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
|
// notify final connection
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
onConnectionChanged(connectionManager.getConnection());
|
onConnectionChanged(connectionManager.getConnection());
|
||||||
|
|
Loading…
Reference in a new issue