diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 5ee14e6da9..0971af60cf 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -108,7 +108,7 @@ static int AppInitRPC(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return EXIT_FAILURE; } - // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) + // Check for -chain, -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) try { SelectBaseParams(ChainNameFromCommandLine()); } catch (const std::exception& e) { diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 43fa3fdfb9..47c7a04a57 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -41,7 +41,7 @@ static int AppInitRawTx(int argc, char* argv[]) // ParseParameters(argc, argv); - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) + // Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause) try { SelectParams(ChainNameFromCommandLine()); } catch (const std::exception& e) { diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 9bab3a2026..e0a711c04e 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -109,7 +109,7 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) + // Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause) try { SelectParams(ChainNameFromCommandLine()); } catch (const std::exception& e) { diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 43c9a13c54..ff1331a524 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -17,6 +17,7 @@ const std::string CBaseChainParams::REGTEST = "regtest"; void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp) { strUsage += HelpMessageGroup(_("Chain selection options:")); + strUsage += HelpMessageOpt("-chain=", _("Use the chain (default: main). Allowed values: main, testnet, regtest")); strUsage += HelpMessageOpt("-testnet", _("Use the test chain")); if (debugHelp) { strUsage += HelpMessageOpt("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. " @@ -98,5 +99,5 @@ std::string ChainNameFromCommandLine() return CBaseChainParams::REGTEST; if (fTestNet) return CBaseChainParams::TESTNET; - return CBaseChainParams::MAIN; + return GetArg("-chain", CBaseChainParams::MAIN); } diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 72f5f4aac9..a28cc76948 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -623,7 +623,7 @@ int main(int argc, char *argv[]) // - QSettings() will use the new application name after this, resulting in network-specific settings // - Needs to be done before createOptionsModel - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) + // Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause) try { SelectParams(ChainNameFromCommandLine()); } catch(std::exception &e) { diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index e0961fe7dd..6498b02358 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -641,7 +641,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) // Start client minimized QString strArgs = "-min"; // Set -testnet /-regtest options - strArgs += QString::fromStdString(strprintf(" -testnet=%d -regtest=%d", GetBoolArg("-testnet", false), GetBoolArg("-regtest", false))); + strArgs += QString::fromStdString(strprintf(" -chain=%s", ChainNameFromCommandLine())); #ifdef UNICODE boost::scoped_array args(new TCHAR[strArgs.length() + 1]); @@ -752,7 +752,7 @@ bool SetStartOnSystemStartup(bool fAutoStart) optionFile << "Name=Bitcoin\n"; else optionFile << strprintf("Name=Bitcoin (%s)\n", chain); - optionFile << "Exec=" << pszExePath << strprintf(" -min -testnet=%d -regtest=%d\n", GetBoolArg("-testnet", false), GetBoolArg("-regtest", false)); + optionFile << "Exec=" << pszExePath << strprintf(" -min -chain=%s\n", chain); optionFile << "Terminal=false\n"; optionFile << "Hidden=false\n"; optionFile.close();