From 29cc0e0fdbba40df0f71f1aec6bc7fd88e0f7339 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Wed, 21 Jul 2021 00:51:56 -0400 Subject: [PATCH] New directory structure for windoze --- src/util.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index a470448bb..8295bec69 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -514,11 +514,20 @@ boost::filesystem::path GetDefaultDataDir() // an old wallet.dat from the Ice Ages :) #ifdef _WIN32 // Windows - pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo" / symbol; + pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Hush" / symbol; + // Always use .hush/HUSH3, if it exists (even if .komodo/HUSH3 exists) if(fs::is_directory(pathRet)) { - // legacy directory, use that + return pathRet; } else { - pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Hush" / symbol; + pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo" / symbol; + if(fs::is_directory(pathRet)) { + // existing legacy directory, use that for backward compat + return pathRet; + } else { + // For new clones, use Hush/HUSH3 + pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Hush" / symbol; + return pathRet; + } } return pathRet; #else