From 64a9cce837500eeb9dc93b5004810e56d71575f5 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 13 Jan 2021 16:23:02 +0200 Subject: [PATCH] log level revert and minor startup fixes --- .../java/com/sparrowwallet/sparrow/AppServices.java | 10 ++++++---- src/main/java/com/sparrowwallet/sparrow/net/Bwt.java | 2 +- .../preferences/GeneralPreferencesController.java | 2 ++ src/main/resources/logback.xml | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppServices.java b/src/main/java/com/sparrowwallet/sparrow/AppServices.java index 10877678..50b941d3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppServices.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppServices.java @@ -441,11 +441,13 @@ public class AppServices { @Subscribe public void fiatCurrencySelected(FiatCurrencySelectedEvent event) { - ratesService.cancel(); + if(ratesService != null) { + ratesService.cancel(); - if(Config.get().getMode() != Mode.OFFLINE && event.getExchangeSource() != ExchangeSource.NONE) { - ratesService = createRatesService(event.getExchangeSource(), event.getCurrency()); - ratesService.start(); + if(Config.get().getMode() != Mode.OFFLINE && event.getExchangeSource() != ExchangeSource.NONE) { + ratesService = createRatesService(event.getExchangeSource(), event.getCurrency()); + ratesService.start(); + } } } diff --git a/src/main/java/com/sparrowwallet/sparrow/net/Bwt.java b/src/main/java/com/sparrowwallet/sparrow/net/Bwt.java index ed2123fe..2b3e5933 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/Bwt.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/Bwt.java @@ -96,7 +96,7 @@ public class Bwt { } bwtConfig.verbose = log.isDebugEnabled() ? 2 : 0; - if(!log.isInfoEnabled()) { + if(!log.isDebugEnabled()) { bwtConfig.setupLogger = false; } diff --git a/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java b/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java index 697b6e31..cb14a16a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java +++ b/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java @@ -58,6 +58,8 @@ public class GeneralPreferencesController extends PreferencesDetailController { public void initializeView(Config config) { if(config.getBitcoinUnit() != null) { bitcoinUnit.setValue(config.getBitcoinUnit()); + } else { + bitcoinUnit.setValue(BitcoinUnit.AUTO); } bitcoinUnit.valueProperty().addListener((observable, oldValue, newValue) -> { diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 27e7c41b..5abd8741 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -22,7 +22,7 @@ - +