Skip to content

Commit

Permalink
bitcoin-cli: Add missing SelectParamsFromCommandLine
Browse files Browse the repository at this point in the history
The SelectParamsFromCommandLine call was missing in bitcoin-cli,
which caused `-testnet` and `-regtest` to be ignored. Add this
call just like in bitcoind.cpp.
  • Loading branch information
laanwj committed Nov 28, 2013
1 parent 4ae42d4 commit 9d2b73d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bitcoin-cli.cpp
Expand Up @@ -7,6 +7,7 @@
#include "init.h"
#include "rpcclient.h"
#include "ui_interface.h" /* for _(...) */
#include "chainparams.h"

#include <boost/filesystem/operations.hpp>

Expand All @@ -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"))
{
Expand Down

0 comments on commit 9d2b73d

Please sign in to comment.