diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-01 10:50:22 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-06-01 10:51:03 +0200 |
commit | f259263a7b11c6ff925851985ef0082b0a190a57 (patch) | |
tree | a51397f634045c3535eca2c01eb985939bd97ca5 /src | |
parent | ef2d062c9f723134b430f60ee23c920ec4988194 (diff) | |
parent | cd5622dcaf55ba08d33574e36bbd21be76aa3513 (diff) |
Merge #10447: Make bitcoind invalid argument error message specific
cd5622d Make bitcoind invalid argument error message specific (Wladimir J. van der Laan)
Tree-SHA512: 78999b9359685c4090f9a112e1d02bdddac22173f5f04600773b042acb9481ebb54d0f73d9d6d74249f845f497927a58d59de69bf33e3dccf096c3c80c7ebf6b
Diffstat (limited to 'src')
-rw-r--r-- | src/bitcoind.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 31680a8ec7..5922e45801 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -117,17 +117,14 @@ bool AppInit(int argc, char* argv[]) 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 SoftSetBoolArg("-server", true); // Set this early so that parameter interactions go to console |