|
|
@ -59,13 +59,36 @@ bool AppInit(int argc, char* argv[]) |
|
|
|
boost::thread* detectShutdownThread = NULL; |
|
|
|
boost::thread* detectShutdownThread = NULL; |
|
|
|
|
|
|
|
|
|
|
|
bool fRet = false; |
|
|
|
bool fRet = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Parameters
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main()
|
|
|
|
|
|
|
|
ParseParameters(argc, argv); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Process help and version before taking care about datadir
|
|
|
|
|
|
|
|
if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mapArgs.count("-version")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
strUsage += LicenseInfo(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
strUsage += "\n" + _("Usage:") + "\n" + |
|
|
|
|
|
|
|
" bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strUsage += "\n" + HelpMessage(HMM_BITCOIND); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(stdout, "%s", strUsage.c_str()); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
//
|
|
|
|
|
|
|
|
// Parameters
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main()
|
|
|
|
|
|
|
|
ParseParameters(argc, argv); |
|
|
|
|
|
|
|
if (!boost::filesystem::is_directory(GetDataDir(false))) |
|
|
|
if (!boost::filesystem::is_directory(GetDataDir(false))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); |
|
|
|
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); |
|
|
@ -84,26 +107,6 @@ bool AppInit(int argc, char* argv[]) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mapArgs.count("-version")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
strUsage += LicenseInfo(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
strUsage += "\n" + _("Usage:") + "\n" + |
|
|
|
|
|
|
|
" bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strUsage += "\n" + HelpMessage(HMM_BITCOIND); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(stdout, "%s", strUsage.c_str()); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Command-line RPC
|
|
|
|
// Command-line RPC
|
|
|
|
bool fCommandLine = false; |
|
|
|
bool fCommandLine = false; |
|
|
|
for (int i = 1; i < argc; i++) |
|
|
|
for (int i = 1; i < argc; i++) |
|
|
|