mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-23 04:29:22 +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;
|
||||
|
||||
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());
|
||||
|
|
Loading…
Reference in a new issue