mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
--enable-liquid: change default datadir to .liquid
This commit is contained in:
parent
1f67fec0e9
commit
3b1ca174d7
1 changed files with 28 additions and 0 deletions
28
src/util.cpp
28
src/util.cpp
|
|
@ -704,6 +704,33 @@ void PrintExceptionContinue(const std::exception* pex, const char* pszThread)
|
|||
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
|
||||
}
|
||||
|
||||
#ifdef LIQUID
|
||||
fs::path GetDefaultDataDir()
|
||||
{
|
||||
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Liquid
|
||||
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Liquid
|
||||
// Mac: ~/Library/Application Support/Liquid
|
||||
// Unix: ~/.liquid
|
||||
#ifdef WIN32
|
||||
// Windows
|
||||
return GetSpecialFolderPath(CSIDL_APPDATA) / "Liquid";
|
||||
#else
|
||||
fs::path pathRet;
|
||||
char* pszHome = getenv("HOME");
|
||||
if (pszHome == nullptr || strlen(pszHome) == 0)
|
||||
pathRet = fs::path("/");
|
||||
else
|
||||
pathRet = fs::path(pszHome);
|
||||
#ifdef MAC_OSX
|
||||
// Mac
|
||||
return pathRet / "Library/Application Support/Liquid";
|
||||
#else
|
||||
// Unix
|
||||
return pathRet / ".liquid";
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
fs::path GetDefaultDataDir()
|
||||
{
|
||||
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Bitcoin
|
||||
|
|
@ -729,6 +756,7 @@ fs::path GetDefaultDataDir()
|
|||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static fs::path g_blocks_path_cached;
|
||||
static fs::path g_blocks_path_cache_net_specific;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue