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.
This commit is contained in:
parent
4ae42d43a4
commit
9d2b73d19f
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "rpcclient.h"
|
#include "rpcclient.h"
|
||||||
#include "ui_interface.h" /* for _(...) */
|
#include "ui_interface.h" /* for _(...) */
|
||||||
|
#include "chainparams.h"
|
||||||
|
|
||||||
#include <boost/filesystem/operations.hpp>
|
#include <boost/filesystem/operations.hpp>
|
||||||
|
|
||||||
|
@ -26,6 +27,11 @@ static bool AppInitRPC(int argc, char* argv[])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
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"))
|
if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue