| 703 | } |
| 704 | |
| 705 | fs::path GetDefaultDataDir() |
| 706 | { |
| 707 | // Windows < Vista: C:\Documents and Settings\Username\Application Data\BitcoinGold |
| 708 | // Windows >= Vista: C:\Users\Username\AppData\Roaming\BitcoinGold |
| 709 | // Mac: ~/Library/Application Support/BitcoinGold |
| 710 | // Unix: ~/.bitcoingold |
| 711 | #ifdef WIN32 |
| 712 | // Windows |
| 713 | return GetSpecialFolderPath(CSIDL_APPDATA) / "BitcoinGold"; |
| 714 | #else |
| 715 | fs::path pathRet; |
| 716 | char* pszHome = getenv("HOME"); |
| 717 | if (pszHome == nullptr || strlen(pszHome) == 0) |
| 718 | pathRet = fs::path("/"); |
| 719 | else |
| 720 | pathRet = fs::path(pszHome); |
| 721 | #ifdef MAC_OSX |
| 722 | // Mac |
| 723 | return pathRet / "Library/Application Support/BitcoinGold"; |
| 724 | #else |
| 725 | // Unix |
| 726 | return pathRet / ".bitcoingold"; |
| 727 | #endif |
| 728 | #endif |
| 729 | } |
| 730 | |
| 731 | static fs::path g_blocks_path_cached; |
| 732 | static fs::path g_blocks_path_cache_net_specific; |
no test coverage detected