| 1191 | } |
| 1192 | |
| 1193 | bool AppInitSanityChecks() |
| 1194 | { |
| 1195 | // ********************************************************* Step 4: sanity checks |
| 1196 | |
| 1197 | // Initialize elliptic curve code |
| 1198 | std::string sha256_algo = SHA256AutoDetect(); |
| 1199 | LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo); |
| 1200 | RandomInit(); |
| 1201 | ECC_Start(); |
| 1202 | globalVerifyHandle.reset(new ECCVerifyHandle()); |
| 1203 | |
| 1204 | // Sanity check |
| 1205 | if (!InitSanityCheck()) |
| 1206 | return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), _(PACKAGE_NAME))); |
| 1207 | |
| 1208 | // Probe the data directory lock to give an early error message, if possible |
| 1209 | // We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened, |
| 1210 | // and a fork will cause weird behavior to it. |
| 1211 | return LockDataDirectory(true); |
| 1212 | } |
| 1213 | |
| 1214 | bool AppInitLockDataDirectory() |
| 1215 | { |
no test coverage detected