This commit is contained in:
Matthew Zipkin 2024-04-29 04:32:52 +02:00 committed by GitHub
commit 8fc9b5ce3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 5 deletions

View File

@ -59,7 +59,7 @@ The `includeconf=<file>` option in the `bitcoin.conf` file can be used to includ
Operating System | Data Directory | Example Path
-- | -- | --
Windows | `%APPDATA%\Bitcoin\` | `C:\Users\username\AppData\Roaming\Bitcoin\bitcoin.conf`
Windows | `%APPDATA%\Bitcoin\` | `C:\Users\username\AppData\Local\Bitcoin\bitcoin.conf`
Linux | `$HOME/.bitcoin/` | `/home/username/.bitcoin/bitcoin.conf`
macOS | `$HOME/Library/Application Support/Bitcoin/` | `/Users/username/Library/Application Support/Bitcoin/bitcoin.conf`

View File

@ -28,7 +28,7 @@ Platform | Data directory path
---------|--------------------
Linux | `$HOME/.bitcoin/`
macOS | `$HOME/Library/Application Support/Bitcoin/`
Windows | `%APPDATA%\Bitcoin\` <sup>[\[1\]](#note1)</sup>
Windows | `%LOCALAPPDATA%\Bitcoin\` <sup>[\[1\]](#note1)</sup>
2. A custom data directory path can be specified with the `-datadir` option.

View File

@ -20,7 +20,7 @@ By default, wallets are created in the `wallets` folder of the data directory, w
| Operating System | Default wallet directory |
| -----------------|:------------------------------------------------------------|
| Linux | `/home/<user>/.bitcoin/wallets` |
| Windows | `C:\Users\<user>\AppData\Roaming\Bitcoin\wallets` |
| Windows | `C:\Users\<user>\AppData\Local\Bitcoin\wallets` |
| macOS | `/Users/<user>/Library/Application Support/Bitcoin/wallets` |
### 1.2 Encrypting the Wallet

View File

@ -0,0 +1,7 @@
Files
-----
The default data directory on Windows has been moved from `C:\Users\Username\AppData\Roaming\Bitcoin`
to `C:\Users\Username\AppData\Local\Bitcoin`. Bitcoin Core will check the existence
of the old directory first and continue to use that directory for backwards
compatability if it is present.

View File

@ -696,12 +696,20 @@ bool HasTestOption(const ArgsManager& args, const std::string& test_option)
fs::path GetDefaultDataDir()
{
// Windows: C:\Users\Username\AppData\Roaming\Bitcoin
// Windows:
// old: C:\Users\Username\AppData\Roaming\Bitcoin
// new: C:\Users\Username\AppData\Local\Bitcoin
// macOS: ~/Library/Application Support/Bitcoin
// Unix-like: ~/.bitcoin
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "Bitcoin";
// Check for existence of datadir in old location and keep it there
fs::path legacy_path = GetSpecialFolderPath(CSIDL_APPDATA) / "Bitcoin";
if (fs::exists(legacy_path))
return legacy_path;
// Otherwise, fresh installs can start in the new, "proper" location
return GetSpecialFolderPath(CSIDL_LOCAL_APPDATA) / "Bitcoin";
#else
fs::path pathRet;
char* pszHome = getenv("HOME");