aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoind.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-06-23 18:04:44 +0200
committerGavin Andresen <gavinandresen@gmail.com>2013-08-22 11:05:45 +1000
commita2189fbaf65dd56c808dc7429b800e70d31178c3 (patch)
tree3a9e6d8fcb69d25f2e9f6f1091252367137f056c /src/bitcoind.cpp
parent3624356e82015c980fa7b7e60dfbe128665b1952 (diff)
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
Diffstat (limited to 'src/bitcoind.cpp')
-rw-r--r--src/bitcoind.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index be18f9ae83..02e4e7d6e7 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -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);
}