From e1f405d886500b32ad19d9b04c5b8e34bde1cdf6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 15 Mar 2021 11:25:30 +0200 Subject: [PATCH] default to hd capture on new osx installs --- src/main/java/com/sparrowwallet/sparrow/MainApp.java | 5 +++++ src/main/java/com/sparrowwallet/sparrow/io/Config.java | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/MainApp.java b/src/main/java/com/sparrowwallet/sparrow/MainApp.java index 609c4e25..574cbc37 100644 --- a/src/main/java/com/sparrowwallet/sparrow/MainApp.java +++ b/src/main/java/com/sparrowwallet/sparrow/MainApp.java @@ -19,6 +19,7 @@ import javafx.application.Application; import javafx.scene.text.Font; import javafx.stage.Stage; import org.controlsfx.glyphfont.GlyphFontRegistry; +import org.controlsfx.tools.Platform; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.bridge.SLF4JBridgeHandler; @@ -79,6 +80,10 @@ public class MainApp extends Application { Config.get().setCoreWallet(""); } + if(Config.get().getHdCapture() == null && Platform.getCurrent() == Platform.OSX) { + Config.get().setHdCapture(Boolean.TRUE); + } + System.setProperty(Wallet.ALLOW_DERIVATIONS_MATCHING_OTHER_SCRIPT_TYPES_PROPERTY, Boolean.toString(!Config.get().isValidateDerivationPaths())); AppController appController = AppServices.newAppWindow(stage); diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Config.java b/src/main/java/com/sparrowwallet/sparrow/io/Config.java index ff1de8bd..f6a316e1 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Config.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Config.java @@ -37,7 +37,7 @@ public class Config { private List recentWalletFiles; private Integer keyDerivationPeriod; private File hwi; - private boolean hdCapture; + private Boolean hdCapture; private ServerType serverType; private String publicElectrumServer; private String coreServer; @@ -263,11 +263,15 @@ public class Config { flush(); } - public boolean isHdCapture() { + public Boolean getHdCapture() { return hdCapture; } - public void setHdCapture(boolean hdCapture) { + public Boolean isHdCapture() { + return hdCapture != null && hdCapture; + } + + public void setHdCapture(Boolean hdCapture) { this.hdCapture = hdCapture; flush(); }