|
|
@ -1297,7 +1297,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
|
|
|
|
// Sanity check
|
|
|
|
if (!InitSanityCheck()) |
|
|
|
return InitError(_("Initialization sanity check failed. Komodo is shutting down.")); |
|
|
|
return InitError(_("Initialization sanity check failed. Please check for insanity. Hush is shutting down!")); |
|
|
|
|
|
|
|
std::string strDataDir = GetDataDir().string(); |
|
|
|
#ifdef ENABLE_WALLET |
|
|
@ -1305,7 +1305,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
if (strWalletFile != boost::filesystem::basename(strWalletFile) + boost::filesystem::extension(strWalletFile)) |
|
|
|
return InitError(strprintf(_("Wallet %s resides outside data directory %s"), strWalletFile, strDataDir)); |
|
|
|
#endif |
|
|
|
// Make sure only a single Bitcoin process is using the data directory.
|
|
|
|
// Make sure only a single Hush process is using the data directory.
|
|
|
|
boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; |
|
|
|
FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist.
|
|
|
|
if (file) fclose(file); |
|
|
@ -1315,9 +1315,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
try { |
|
|
|
static boost::interprocess::file_lock lock(pathLockFile.string().c_str()); |
|
|
|
if (!lock.try_lock()) |
|
|
|
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Komodo is probably already running."), strDataDir)); |
|
|
|
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Hush is probably already running."), strDataDir)); |
|
|
|
} catch(const boost::interprocess::interprocess_exception& e) { |
|
|
|
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Komodo is probably already running.") + " %s.", strDataDir, e.what())); |
|
|
|
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Hush is probably already running.") + " %s.", strDataDir, e.what())); |
|
|
|
} |
|
|
|
|
|
|
|
#ifndef _WIN32 |
|
|
@ -1326,7 +1326,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
if (GetBoolArg("-shrinkdebugfile", !fDebug)) |
|
|
|
ShrinkDebugFile(); |
|
|
|
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); |
|
|
|
LogPrintf("Komodo version %s (%s)\n", FormatFullVersion(), CLIENT_DATE); |
|
|
|
LogPrintf("Hush version %s (%s)\n", FormatFullVersion(), CLIENT_DATE); |
|
|
|
|
|
|
|
if (fPrintToDebugLog) |
|
|
|
OpenDebugLog(); |
|
|
|