aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-28 17:28:27 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-28 17:37:01 +0100
commit9d2b73d19f97d37517ed3526ab959b1aa405d525 (patch)
tree44ad56a13306e225e2fb5ffa255bd0fdacbd22cf /src/bitcoin-cli.cpp
parent4ae42d43a47ff4b004ac51cae043c4c9f0ee390e (diff)
bitcoin-cli: Add missing SelectParamsFromCommandLine
The SelectParamsFromCommandLine call was missing in bitcoin-cli, which caused `-testnet` and `-regtest` to be ignored. Add this call just like in bitcoind.cpp.
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index e4a648e980..4e65947464 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -7,6 +7,7 @@
#include "init.h"
#include "rpcclient.h"
#include "ui_interface.h" /* for _(...) */
+#include "chainparams.h"
#include <boost/filesystem/operations.hpp>
@@ -26,6 +27,11 @@ static bool AppInitRPC(int argc, char* argv[])
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 (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
{