Skip to content

Commit f259263

Browse files
committed
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
2 parents ef2d062 + cd5622d commit f259263

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/bitcoind.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,14 @@ bool AppInit(int argc, char* argv[])
117117
return false;
118118
}
119119

120-
// Command-line RPC
121-
bool fCommandLine = false;
122-
for (int i = 1; i < argc; i++)
123-
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "bitcoin:"))
124-
fCommandLine = true;
125-
126-
if (fCommandLine)
127-
{
128-
fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n");
129-
exit(EXIT_FAILURE);
120+
// Error out when loose non-argument tokens are encountered on command line
121+
for (int i = 1; i < argc; i++) {
122+
if (!IsSwitchChar(argv[i][0])) {
123+
fprintf(stderr, "Error: Command line contains unexpected token '%s', see bitcoind -h for a list of options.\n", argv[i]);
124+
exit(EXIT_FAILURE);
125+
}
130126
}
127+
131128
// -server defaults to true for bitcoind but not for the GUI so do this here
132129
SoftSetBoolArg("-server", true);
133130
// Set this early so that parameter interactions go to console

0 commit comments

Comments
 (0)