mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-02-03 18:54:38 +00:00
Edited init.cpp to include a check that -datadir exists
This commit is contained in:
parent
1179257bfd
commit
ed2c01405f
@ -140,10 +140,19 @@ bool AppInit2(int argc, char* argv[])
|
|||||||
ParseParameters(argc, argv);
|
ParseParameters(argc, argv);
|
||||||
|
|
||||||
if (mapArgs.count("-datadir"))
|
if (mapArgs.count("-datadir"))
|
||||||
|
{
|
||||||
|
if (filesystem::is_directory(filesystem::system_complete(mapArgs["-datadir"])))
|
||||||
{
|
{
|
||||||
filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
|
filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
|
||||||
strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
|
strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error: Specified directory does not exist\n");
|
||||||
|
Shutdown(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ReadConfigFile(mapArgs, mapMultiArgs); // Must be done after processing datadir
|
ReadConfigFile(mapArgs, mapMultiArgs); // Must be done after processing datadir
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user