added path to files on the Mac

This commit is contained in:
Diego Basch 2014-03-07 20:19:18 -08:00
parent 2df74e97dc
commit fac6c6fabe

View File

@ -51,8 +51,11 @@ public class BlockFileLoader implements Iterable<Block>, Iterator<Block> {
*/
public static List<File> getReferenceClientBlockFileList() {
String defaultDataDir;
if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) {
String OS = System.getProperty("os.name").toLowerCase();
if (OS.indexOf("win") >= 0) {
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/";
} else {
defaultDataDir = System.getProperty("user.home") + "/.bitcoin/blocks/";
}