diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-01-16 12:32:15 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-01-17 10:06:13 +0100 |
commit | 49e5f3ff7e940b8da7d9e7252d2b1e27bd192ae4 (patch) | |
tree | 76e2e1108a6a9f94cd33828f2d3f88fe31c9e943 /src | |
parent | 66e3af709dd444b2d85e15c56f4608c700ff82ee (diff) |
rpc: Add deprecation error for `getinfo`
Add a short informative deprecation message when users use `getinfo`,
that points them to the new calls where to get the different information fields.
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/misc.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 95a27d474b..3bcad16316 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -668,6 +668,18 @@ UniValue echo(const JSONRPCRequest& request) return request.params; } +static UniValue getinfo_deprecated(const JSONRPCRequest& request) +{ + throw JSONRPCError(RPC_METHOD_NOT_FOUND, + "getinfo\n" + "\nThis call was removed in version 0.16.0. Use the appropriate fields from:\n" + "- getblockchaininfo: blocks, difficulty, chain\n" + "- getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings\n" + "- getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion\n" + "\nbitcoin-cli has the option -getinfo to collect and format these in the old format." + ); +} + static const CRPCCommand commands[] = { // category name actor (function) argNames // --------------------- ------------------------ ----------------------- ---------- @@ -682,6 +694,7 @@ static const CRPCCommand commands[] = { "hidden", "setmocktime", &setmocktime, {"timestamp"}}, { "hidden", "echo", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, { "hidden", "echojson", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, + { "hidden", "getinfo", &getinfo_deprecated, {}}, }; void RegisterMiscRPCCommands(CRPCTable &t) |