Skip to content

Commit 5c56ee1

Browse files
committed
Merge pull request #3328
9d2b73d bitcoin-cli: Add missing SelectParamsFromCommandLine (Wladimir J. van der Laan)
2 parents 207cfbf + 9d2b73d commit 5c56ee1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "init.h"
88
#include "rpcclient.h"
99
#include "ui_interface.h" /* for _(...) */
10+
#include "chainparams.h"
1011

1112
#include <boost/filesystem/operations.hpp>
1213

@@ -26,6 +27,11 @@ static bool AppInitRPC(int argc, char* argv[])
2627
return false;
2728
}
2829
ReadConfigFile(mapArgs, mapMultiArgs);
30+
// Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause)
31+
if (!SelectParamsFromCommandLine()) {
32+
fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
33+
return false;
34+
}
2935

3036
if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
3137
{

0 commit comments

Comments
 (0)