Use Utils.isWindows() helper consistently.

This commit is contained in:
Andreas Schildbach 2018-03-13 12:36:34 +01:00
parent e0d9683bd5
commit 9e2b0c05c7
2 changed files with 2 additions and 2 deletions

View file

@ -277,7 +277,7 @@ public class SPVBlockStore implements BlockStore {
public void close() throws BlockStoreException {
try {
buffer.force();
if (System.getProperty("os.name").toLowerCase().contains("win")) {
if (Utils.isWindows()) {
log.info("Windows mmap hack: Forcing buffer cleaning");
WindowsMMapHack.forceRelease(buffer);
}

View file

@ -55,7 +55,7 @@ public class BlockFileLoader implements Iterable<Block>, Iterator<Block> {
public static List<File> getReferenceClientBlockFileList() {
String defaultDataDir;
String OS = System.getProperty("os.name").toLowerCase();
if (OS.indexOf("win") >= 0) {
if (Utils.isWindows()) {
defaultDataDir = System.getenv("APPDATA") + "\\.bitcoin\\blocks\\";
} else if (OS.indexOf("mac") >= 0 || (OS.indexOf("darwin") >= 0)) {
defaultDataDir = System.getProperty("user.home") + "/Library/Application Support/Bitcoin/blocks/";