mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
revert dash#1494: Don't try to create empty datadir before the real path is known
This commit is contained in:
parent
c34638d20b
commit
cb4d60159d
@ -138,8 +138,7 @@ static int AppInitRPC(int argc, char* argv[])
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
bool datadirFromCmdLine = gArgs.IsArgSet("-datadir");
|
||||
if (datadirFromCmdLine && !fs::is_directory(GetDataDir(false))) {
|
||||
if (!fs::is_directory(GetDataDir(false))) {
|
||||
tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", ""));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@ -147,10 +146,6 @@ static int AppInitRPC(int argc, char* argv[])
|
||||
tfm::format(std::cerr, "Error reading configuration file: %s\n", error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (!datadirFromCmdLine && !fs::is_directory(GetDataDir(false))) {
|
||||
tfm::format(std::cerr, "Error: Specified data directory \"%s\" from config file does not exist.\n", gArgs.GetArg("-datadir", ""));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)
|
||||
try {
|
||||
SelectBaseParams(gArgs.GetChainName());
|
||||
|
@ -87,19 +87,13 @@ static bool AppInit(int argc, char* argv[])
|
||||
util::Ref context{node};
|
||||
try
|
||||
{
|
||||
bool datadirFromCmdLine = gArgs.IsArgSet("-datadir");
|
||||
if (datadirFromCmdLine && !fs::is_directory(GetDataDir(false)))
|
||||
if (!fs::is_directory(GetDataDir(false)))
|
||||
{
|
||||
return InitError(Untranslated(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", ""))));
|
||||
}
|
||||
if (!gArgs.ReadConfigFiles(error, true)) {
|
||||
return InitError(Untranslated(strprintf("Error reading configuration file: %s\n", error)));
|
||||
}
|
||||
if (!datadirFromCmdLine && !fs::is_directory(GetDataDir(false)))
|
||||
{
|
||||
tfm::format(std::cerr, "Error: Specified data directory \"%s\" from config file does not exist.\n", gArgs.GetArg("-datadir", ""));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
|
||||
try {
|
||||
SelectParams(gArgs.GetChainName());
|
||||
|
Loading…
Reference in New Issue
Block a user