diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -21,7 +21,6 @@ #include "util.h" #include "utilstrencodings.h" -#include #include #include @@ -126,19 +125,18 @@ return false; } - // Command-line RPC - bool fCommandLine = false; - for (int i = 1; i < argc; i++) - if (!IsSwitchChar(argv[i][0]) && - !boost::algorithm::istarts_with(argv[i], "bitcoin:")) - fCommandLine = true; - - if (fCommandLine) { - fprintf(stderr, "Error: There is no RPC client functionality in " - "bitcoind anymore. Use the bitcoin-cli utility " - "instead.\n"); - exit(EXIT_FAILURE); + // Error out when loose non-argument tokens are encountered on command + // line + for (int i = 1; i < argc; i++) { + if (!IsSwitchChar(argv[i][0])) { + fprintf(stderr, "Error: Command line contains unexpected token " + "'%s', see bitcoind -h for a list of " + "options.\n", + argv[i]); + exit(EXIT_FAILURE); + } } + // -server defaults to true for bitcoind but not for the GUI so do this // here gArgs.SoftSetBoolArg("-server", true);