Merge pull request #3328

9d2b73d bitcoin-cli: Add missing SelectParamsFromCommandLine (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan 2013-11-29 07:55:48 +01:00
commit 5c56ee1ace
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

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