Skip to content

Commit d445a2c

Browse files
committed
Merge #10857: [RPC] Add a deprecation warning to getinfo's output
1c9b818 getinfo deprecation warning (Andrew Chow) Pull request description: This is an alternative to #10841 This PR implements @gmaxwell's suggestion of a `nag` field for getinfo which warns about the deprecation. Instead of calling it `nag`, I have named it `deprecation-warning`. The output of `getinfo` will look like this: ``` { "version": 149900, "protocolversion": 70015, "walletversion": 139900, "balance": 0.00000000, "blocks": 476281, "timeoffset": 0, "connections": 2, "proxy": "", "difficulty": 804525194568.1318, "testnet": false, "keypoololdest": 1496858803, "keypoolsize": 197, "unlocked_until": 0, "paytxfee": 0.00000000, "relayfee": 0.00001000, "errors": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications", "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16" } ``` I think this should be tagged for 0.15 Tree-SHA512: ea1bac96a67f797519e8748ddd661cf0a1127cbc38f145b98f10cf9b54dcf0519b353062ce9888e1f51875497299c75ff5147566944451bc3fc117620e773489
2 parents 9022aa3 + 1c9b818 commit d445a2c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/rpc/misc.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,23 @@ UniValue getinfo(const JSONRPCRequest& request)
5151
"\nDEPRECATED. Returns an object containing various state info.\n"
5252
"\nResult:\n"
5353
"{\n"
54+
" \"deprecation-warning\": \"...\" (string) warning that the getinfo command is deprecated and will be removed in 0.16\n"
5455
" \"version\": xxxxx, (numeric) the server version\n"
5556
" \"protocolversion\": xxxxx, (numeric) the protocol version\n"
5657
" \"walletversion\": xxxxx, (numeric) the wallet version\n"
5758
" \"balance\": xxxxxxx, (numeric) the total bitcoin balance of the wallet\n"
5859
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
5960
" \"timeoffset\": xxxxx, (numeric) the time offset\n"
6061
" \"connections\": xxxxx, (numeric) the number of connections\n"
61-
" \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n"
62+
" \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n"
6263
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
6364
" \"testnet\": true|false, (boolean) if the server is using testnet or not\n"
6465
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n"
6566
" \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
6667
" \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n"
6768
" \"paytxfee\": x.xxxx, (numeric) the transaction fee set in " + CURRENCY_UNIT + "/kB\n"
6869
" \"relayfee\": x.xxxx, (numeric) minimum relay fee for transactions in " + CURRENCY_UNIT + "/kB\n"
69-
" \"errors\": \"...\" (string) any error messages\n"
70+
" \"errors\": \"...\" (string) any error messages\n"
7071
"}\n"
7172
"\nExamples:\n"
7273
+ HelpExampleCli("getinfo", "")
@@ -85,6 +86,8 @@ UniValue getinfo(const JSONRPCRequest& request)
8586
GetProxy(NET_IPV4, proxy);
8687

8788
UniValue obj(UniValue::VOBJ);
89+
obj.push_back(Pair("deprecation-warning", "WARNING: getinfo is deprecated and will be fully removed in 0.16."
90+
" Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16"));
8891
obj.push_back(Pair("version", CLIENT_VERSION));
8992
obj.push_back(Pair("protocolversion", PROTOCOL_VERSION));
9093
#ifdef ENABLE_WALLET

0 commit comments

Comments
 (0)