| 1142 | } |
| 1143 | |
| 1144 | static bool LockDataDirectory(bool probeOnly) |
| 1145 | { |
| 1146 | // Make sure only a single Bitcoin process is using the data directory. |
| 1147 | fs::path datadir = gArgs.GetDataDirNet(); |
| 1148 | if (!DirIsWritable(datadir)) { |
| 1149 | return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), fs::PathToString(datadir))); |
| 1150 | } |
| 1151 | if (!LockDirectory(datadir, ".lock", probeOnly)) { |
| 1152 | return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), fs::PathToString(datadir), PACKAGE_NAME)); |
| 1153 | } |
| 1154 | return true; |
| 1155 | } |
| 1156 | |
| 1157 | bool AppInitSanityChecks() |
| 1158 | { |
no test coverage detected