diff options
Diffstat (limited to 'src/bitcoin-cli.cpp')
| -rw-r--r-- | src/bitcoin-cli.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index aa6ce27c5..04b75e7f1 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -5,8 +5,9 @@ #include "util.h" #include "init.h" -#include "bitcoinrpc.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")) { @@ -36,7 +42,7 @@ static bool AppInitRPC(int argc, char* argv[]) " bitcoin-cli [options] help " + _("List commands") + "\n" + " bitcoin-cli [options] help <command> " + _("Get help for a command") + "\n"; - strUsage += "\n" + HelpMessage(HMM_BITCOIN_CLI); + strUsage += "\n" + HelpMessageCli(true); fprintf(stdout, "%s", strUsage.c_str()); return false; |