Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/darkcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ bool AppInit(int argc, char* argv[])
return false;
}

std::string strErr;
if(!masternodeConfig.read(strErr)) {
fprintf(stderr,"Error reading masternode configuration file: %s\n", strErr.c_str());
return false;
}

// Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause)
if (!SelectParamsFromCommandLine()) {
fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
return false;
}

// parse masternode.conf
std::string strErr;
if(!masternodeConfig.read(strErr)) {
fprintf(stderr,"Error reading masternode configuration file: %s\n", strErr.c_str());
return false;
}

if (mapArgs.count("-?") || mapArgs.count("--help"))
{
// First part of help message is specific to darkcoind / RPC client
Expand Down
15 changes: 8 additions & 7 deletions src/qt/darkcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,13 +534,6 @@ int main(int argc, char *argv[])
return false;
}

string strErr;
if(!masternodeConfig.read(strErr)) {
QMessageBox::critical(0, QObject::tr("Darkcoin"),
QObject::tr("Error reading masternode configuration file: %1").arg(strErr.c_str()));
return false;
}

/// 7. Determine network (and switch to network specific options)
// - Do not call Params() before this step
// - Do this after parsing the configuration file, as the network can be switched there
Expand All @@ -567,6 +560,14 @@ int main(int argc, char *argv[])
initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);

#ifdef ENABLE_WALLET
/// 7a. parse masternode.conf
string strErr;
if(!masternodeConfig.read(strErr)) {
QMessageBox::critical(0, QObject::tr("Darkcoin"),
QObject::tr("Error reading masternode configuration file: %1").arg(strErr.c_str()));
return false;
}

/// 8. URI IPC sending
// - Do this early as we don't want to bother initializing if we are just calling IPC
// - Do this *after* setting up the data directory, as the data directory hash is used in the name
Expand Down