mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 08:14:43 +00:00
add file flag fallback to set testnet on startup
This commit is contained in:
@@ -8,6 +8,7 @@ import com.sparrowwallet.sparrow.glyphfont.FontAwesome5Brands;
|
||||
import com.sparrowwallet.sparrow.io.Config;
|
||||
import com.sparrowwallet.sparrow.io.FileType;
|
||||
import com.sparrowwallet.sparrow.io.IOUtils;
|
||||
import com.sparrowwallet.sparrow.io.Storage;
|
||||
import com.sparrowwallet.sparrow.preferences.PreferenceGroup;
|
||||
import com.sparrowwallet.sparrow.preferences.PreferencesDialog;
|
||||
import javafx.application.Application;
|
||||
@@ -138,6 +139,11 @@ public class MainApp extends Application {
|
||||
}
|
||||
}
|
||||
|
||||
File testnetFlag = new File(Storage.getSparrowHome(), "network-" + Network.TESTNET.getName());
|
||||
if(testnetFlag.exists()) {
|
||||
Network.set(Network.TESTNET);
|
||||
}
|
||||
|
||||
if(Network.get() != Network.MAINNET) {
|
||||
log.info("Using " + Network.get() + " configuration");
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ public class Storage {
|
||||
return getSparrowHome();
|
||||
}
|
||||
|
||||
static File getSparrowHome() {
|
||||
public static File getSparrowHome() {
|
||||
if(System.getProperty(MainApp.APP_HOME_PROPERTY) != null) {
|
||||
return new File(System.getProperty(MainApp.APP_HOME_PROPERTY));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user