@@ -23,9 +23,7 @@ std::string HelpMessageCli()
2323 strUsage += HelpMessageOpt (" -?" , _ (" This help message" ));
2424 strUsage += HelpMessageOpt (" -conf=<file>" , strprintf (_ (" Specify configuration file (default: %s)" ), " bitcoin.conf" ));
2525 strUsage += HelpMessageOpt (" -datadir=<dir>" , _ (" Specify data directory" ));
26- strUsage += HelpMessageOpt (" -testnet" , _ (" Use the test network" ));
27- strUsage += HelpMessageOpt (" -regtest" , _ (" Enter regression test mode, which uses a special chain in which blocks can be "
28- " solved instantly. This is intended for regression testing tools and app development." ));
26+ AppendParamsHelpMessages (strUsage);
2927 strUsage += HelpMessageOpt (" -rpcconnect=<ip>" , strprintf (_ (" Send commands to node running on <ip> (default: %s)" ), " 127.0.0.1" ));
3028 strUsage += HelpMessageOpt (" -rpcport=<port>" , strprintf (_ (" Connect to JSON-RPC on <port> (default: %u or testnet: %u)" ), 8332 , 18332 ));
3129 strUsage += HelpMessageOpt (" -rpcwait" , _ (" Wait for RPC server to start" ));
@@ -88,8 +86,10 @@ static bool AppInitRPC(int argc, char* argv[])
8886 return false ;
8987 }
9088 // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)
91- if (!SelectBaseParamsFromCommandLine ()) {
92- fprintf (stderr, " Error: Invalid combination of -regtest and -testnet.\n " );
89+ try {
90+ SelectBaseParams (ChainNameFromCommandLine ());
91+ } catch (std::exception &e) {
92+ fprintf (stderr, " Error: %s\n " , e.what ());
9393 return false ;
9494 }
9595 return true ;
0 commit comments