don't try to start local node if seed node

This commit is contained in:
woodser 2023-08-01 18:32:11 -04:00
parent 1e5b3dc9d7
commit 34f68c474a
2 changed files with 7 additions and 4 deletions

View File

@ -440,7 +440,7 @@ public final class CoreMoneroConnectionsService {
else connectionManager.setAutoSwitch(true); else connectionManager.setAutoSwitch(true);
// start local node if used last and offline // start local node if used last and offline
startLocalNodeIfUsedLast(); maybeStartLocalNode();
// update connection // update connection
if (connectionManager.getConnection() == null || connectionManager.getAutoSwitch()) { if (connectionManager.getConnection() == null || connectionManager.getAutoSwitch()) {
@ -457,7 +457,7 @@ public final class CoreMoneroConnectionsService {
connectionManager.setConnection(connection); connectionManager.setConnection(connection);
// start local node if used last and offline // start local node if used last and offline
startLocalNodeIfUsedLast(); maybeStartLocalNode();
// update connection // update connection
checkConnection(); checkConnection();
@ -472,7 +472,10 @@ public final class CoreMoneroConnectionsService {
} }
} }
private void startLocalNodeIfUsedLast() { private void maybeStartLocalNode() {
// skip if seed node
if (HavenoUtils.havenoSetup == null) return;
// start local node if offline and used as last connection // start local node if offline and used as last connection
if (connectionManager.getConnection() != null && nodeService.equalsUri(connectionManager.getConnection().getUri()) && !nodeService.isOnline()) { if (connectionManager.getConnection() != null && nodeService.equalsUri(connectionManager.getConnection().getUri()) && !nodeService.isOnline()) {

View File

@ -74,7 +74,7 @@ public class HavenoUtils {
private static final int POOL_SIZE = 10; private static final int POOL_SIZE = 10;
private static final ExecutorService POOL = Executors.newFixedThreadPool(POOL_SIZE); private static final ExecutorService POOL = Executors.newFixedThreadPool(POOL_SIZE);
// TODO: better way to share refernces? // TODO: better way to share references?
public static ArbitrationManager arbitrationManager; public static ArbitrationManager arbitrationManager;
public static HavenoSetup havenoSetup; public static HavenoSetup havenoSetup;