mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
update SelectParamsFromCommandLine() handling/order
- move SelectParamsFromCommandLine() from init.cpp to bitcoin.cpp to allow
to use TestNet() for Bitcoin-Qt instead of GetBoolArg("-testnet", false)
- change order in bitcoind.cpp to match bitcoin.cpp functionality
- hamonize error message strings for missing datadir and failing
SelectParamsFromCommandLine() in bitcoin.cpp and bitcoind.cpp
- use TestNet() call in splashscreen.cpp
This commit is contained in:
committed by
Gavin Andresen
parent
3624356e82
commit
a2189fbaf6
@@ -39,10 +39,15 @@ bool AppInit(int argc, char* argv[])
|
||||
ParseParameters(argc, argv);
|
||||
if (!boost::filesystem::is_directory(GetDataDir(false)))
|
||||
{
|
||||
fprintf(stderr, "Error: Specified directory does not exist\n");
|
||||
Shutdown();
|
||||
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
|
||||
return false;
|
||||
}
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
// 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;
|
||||
}
|
||||
|
||||
if (mapArgs.count("-?") || mapArgs.count("--help"))
|
||||
{
|
||||
@@ -67,10 +72,6 @@ bool AppInit(int argc, char* argv[])
|
||||
|
||||
if (fCommandLine)
|
||||
{
|
||||
if (!SelectParamsFromCommandLine()) {
|
||||
fprintf(stderr, "Error: invalid combination of -regtest and -testnet.\n");
|
||||
return false;
|
||||
}
|
||||
int ret = CommandLineRPC(argc, argv);
|
||||
exit(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user