From d7511c62bf0747278894e17cbbee978368565276 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 22 Jan 2025 09:49:50 +0200 Subject: [PATCH] match new behaviour in bitcoin core 28 for default windows data dir --- .../sparrow/preferences/ServerPreferencesController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java b/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java index 0a2fdd72..b9139844 100644 --- a/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java +++ b/src/main/java/com/sparrowwallet/sparrow/preferences/ServerPreferencesController.java @@ -914,7 +914,8 @@ public class ServerPreferencesController extends PreferencesDetailController { if(osType == OsType.MACOS) { return new File(System.getProperty("user.home") + "/Library/Application Support/Bitcoin"); } else if(osType == OsType.WINDOWS) { - return new File(System.getenv("APPDATA") + "/Bitcoin"); + File oldDir = new File(System.getenv("APPDATA") + "/Bitcoin"); + return oldDir.exists() ? oldDir : new File(System.getenv("LOCALAPPDATA") + "/Bitcoin"); } else { return new File(System.getProperty("user.home") + "/.bitcoin"); }