dont start version check service if not on mainnet

This commit is contained in:
Craig Raw 2021-03-12 10:46:59 +02:00
parent 9872fc9221
commit 3e287bfb2d

View file

@ -2,6 +2,7 @@ package com.sparrowwallet.sparrow;
import com.google.common.eventbus.Subscribe; import com.google.common.eventbus.Subscribe;
import com.google.common.net.HostAndPort; import com.google.common.net.HostAndPort;
import com.sparrowwallet.drongo.Network;
import com.sparrowwallet.drongo.address.Address; import com.sparrowwallet.drongo.address.Address;
import com.sparrowwallet.drongo.protocol.Transaction; import com.sparrowwallet.drongo.protocol.Transaction;
import com.sparrowwallet.drongo.psbt.PSBT; import com.sparrowwallet.drongo.psbt.PSBT;
@ -139,7 +140,7 @@ public class AppServices {
restartService(ratesService); restartService(ratesService);
} }
if(config.isCheckNewVersions()) { if(config.isCheckNewVersions() && Network.get() == Network.MAINNET) {
restartService(versionCheckService); restartService(versionCheckService);
} }
} }
@ -520,7 +521,7 @@ public class AppServices {
public void versionCheckStatus(VersionCheckStatusEvent event) { public void versionCheckStatus(VersionCheckStatusEvent event) {
versionCheckService.cancel(); versionCheckService.cancel();
if(Config.get().getMode() != Mode.OFFLINE && event.isEnabled()) { if(Config.get().getMode() != Mode.OFFLINE && event.isEnabled() && Network.get() == Network.MAINNET) {
versionCheckService = createVersionCheckService(); versionCheckService = createVersionCheckService();
versionCheckService.start(); versionCheckService.start();
} }