Skip to content

Commit

Permalink
Change getmininginfo errors field to warnings
Browse files Browse the repository at this point in the history
Changes the errors field to warnings. To maintain compatibility,
the errors field is deprecated and enabled by starting bitcoind with
-deprecatedrpc=getmininginfo
  • Loading branch information
achow101 authored and random-zebra committed Jun 2, 2021
1 parent c04390b commit f15aeea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ UniValue getmininginfo(const JSONRPCRequest& request)
" \"pooledtx\": n (numeric) The size of the mem pool\n"
" \"testnet\": true|false (boolean) If using testnet or not\n"
" \"chain\": \"xxxx\", (string) current network name (main, test, regtest)\n"
" \"errors\": \"...\" (string) (string) any network and blockchain warnings\n"
" \"warnings\": \"...\" (string) any network and blockchain warnings\n"
" \"errors\": \"...\" (string) DEPRECATED. Same as warnings. Only shown when bitcoind is started with -deprecatedrpc=getmininginfo\n"
"}\n"

"\nExamples:\n" +
Expand All @@ -391,6 +392,11 @@ UniValue getmininginfo(const JSONRPCRequest& request)
obj.pushKV("testnet", Params().IsTestnet());
obj.pushKV("chain", Params().NetworkIDString());
obj.pushKV("errors", GetWarnings("statusbar"));
if (IsDeprecatedRPCEnabled("getmininginfo")) {
obj.pushKV("errors", GetWarnings("statusbar"));
} else {
obj.pushKV("warnings", GetWarnings("statusbar"));
}
#ifdef ENABLE_WALLET
obj.pushKV("generate", getgenerate(request));
obj.pushKV("hashespersec", gethashespersec(request));
Expand Down

0 comments on commit f15aeea

Please sign in to comment.