Browse Source

fix ssl handshake issue

bwt
Craig Raw 4 years ago
parent
commit
03abc59ed3
  1. 1
      build.gradle
  2. 6
      src/main/java/com/sparrowwallet/sparrow/io/ExchangeSource.java
  3. 7
      src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java

1
build.gradle

@ -92,6 +92,7 @@ jlink {
requires 'java.logging'
requires 'javafx.base'
requires 'com.fasterxml.jackson.databind'
requires 'jdk.crypto.cryptoki'
}
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages', '--ignore-signing-information', '--exclude-files', '**.png']

6
src/main/java/com/sparrowwallet/sparrow/io/ExchangeSource.java

@ -5,6 +5,8 @@ import com.sparrowwallet.sparrow.event.ExchangeRatesUpdatedEvent;
import javafx.concurrent.ScheduledService;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.InputStream;
import java.io.InputStreamReader;
@ -51,6 +53,7 @@ public enum ExchangeSource {
Gson gson = new Gson();
return gson.fromJson(reader, CoinbaseRates.class);
} catch (Exception e) {
log.error("Error retrieving currency rates", e);
return new CoinbaseRates();
}
}
@ -80,11 +83,14 @@ public enum ExchangeSource {
Gson gson = new Gson();
return gson.fromJson(reader, CoinGeckoRates.class);
} catch (Exception e) {
log.error("Error retrieving currency rates", e);
return new CoinGeckoRates();
}
}
};
private static final Logger log = LoggerFactory.getLogger(ExchangeSource.class);
private final String name;
ExchangeSource(String name) {

7
src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java

@ -11,11 +11,15 @@ import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Currency;
import java.util.List;
public class GeneralPreferencesController extends PreferencesDetailController {
private static final Logger log = LoggerFactory.getLogger(GeneralPreferencesController.class);
@FXML
private ComboBox<BitcoinUnit> bitcoinUnit;
@ -81,6 +85,9 @@ public class GeneralPreferencesController extends PreferencesDetailController {
currenciesService.setOnSucceeded(event -> {
updateCurrencies(currenciesService.getValue());
});
currenciesService.setOnFailed(event -> {
log.error("Error retrieving currencies", event.getSource().getException());
});
currenciesService.start();
}

Loading…
Cancel
Save