Auto merge of #2839 - arcalinea:add_deprecation_alert, r=bitcartel
Add getdeprecationinfo RPC method to return deprecation block height Closes #2828 Returns: ``` { "version": xxxxx, (numeric) the server version "subversion": "/MagicBean:x.y.z[-v]/", (string) the server subversion string "deprecationheight": xxxxx, (numeric) the deprecation block height } ```
This commit is contained in:
commit
a0a010c85c
|
@ -13,6 +13,7 @@
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "deprecation.h"
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
|
@ -398,6 +399,33 @@ static UniValue GetNetworksInfo()
|
||||||
return networks;
|
return networks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UniValue getdeprecationinfo(const UniValue& params, bool fHelp)
|
||||||
|
{
|
||||||
|
const CChainParams& chainparams = Params();
|
||||||
|
if (fHelp || params.size() != 0 || chainparams.NetworkIDString() != "main")
|
||||||
|
throw runtime_error(
|
||||||
|
"getdeprecationinfo\n"
|
||||||
|
"Returns an object containing current version and deprecation block height. Applicable only on mainnet.\n"
|
||||||
|
"\nResult:\n"
|
||||||
|
"{\n"
|
||||||
|
" \"version\": xxxxx, (numeric) the server version\n"
|
||||||
|
" \"subversion\": \"/MagicBean:x.y.z[-v]/\", (string) the server subversion string\n"
|
||||||
|
" \"deprecationheight\": xxxxx, (numeric) the block height at which this version will deprecate and shut down (unless -disabledeprecation is set)\n"
|
||||||
|
"}\n"
|
||||||
|
"\nExamples:\n"
|
||||||
|
+ HelpExampleCli("getdeprecationinfo", "")
|
||||||
|
+ HelpExampleRpc("getdeprecationinfo", "")
|
||||||
|
);
|
||||||
|
|
||||||
|
UniValue obj(UniValue::VOBJ);
|
||||||
|
obj.push_back(Pair("version", CLIENT_VERSION));
|
||||||
|
obj.push_back(Pair("subversion",
|
||||||
|
FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>())));
|
||||||
|
obj.push_back(Pair("deprecationheight", DEPRECATION_HEIGHT));
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
UniValue getnetworkinfo(const UniValue& params, bool fHelp)
|
UniValue getnetworkinfo(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
if (fHelp || params.size() != 0)
|
if (fHelp || params.size() != 0)
|
||||||
|
|
|
@ -265,6 +265,7 @@ static const CRPCCommand vRPCCommands[] =
|
||||||
|
|
||||||
/* P2P networking */
|
/* P2P networking */
|
||||||
{ "network", "getnetworkinfo", &getnetworkinfo, true },
|
{ "network", "getnetworkinfo", &getnetworkinfo, true },
|
||||||
|
{ "network", "getdeprecationinfo", &getdeprecationinfo, true },
|
||||||
{ "network", "addnode", &addnode, true },
|
{ "network", "addnode", &addnode, true },
|
||||||
{ "network", "disconnectnode", &disconnectnode, true },
|
{ "network", "disconnectnode", &disconnectnode, true },
|
||||||
{ "network", "getaddednodeinfo", &getaddednodeinfo, true },
|
{ "network", "getaddednodeinfo", &getaddednodeinfo, true },
|
||||||
|
|
|
@ -238,6 +238,7 @@ extern UniValue getinfo(const UniValue& params, bool fHelp);
|
||||||
extern UniValue getwalletinfo(const UniValue& params, bool fHelp);
|
extern UniValue getwalletinfo(const UniValue& params, bool fHelp);
|
||||||
extern UniValue getblockchaininfo(const UniValue& params, bool fHelp);
|
extern UniValue getblockchaininfo(const UniValue& params, bool fHelp);
|
||||||
extern UniValue getnetworkinfo(const UniValue& params, bool fHelp);
|
extern UniValue getnetworkinfo(const UniValue& params, bool fHelp);
|
||||||
|
extern UniValue getdeprecationinfo(const UniValue& params, bool fHelp);
|
||||||
extern UniValue setmocktime(const UniValue& params, bool fHelp);
|
extern UniValue setmocktime(const UniValue& params, bool fHelp);
|
||||||
extern UniValue resendwallettransactions(const UniValue& params, bool fHelp);
|
extern UniValue resendwallettransactions(const UniValue& params, bool fHelp);
|
||||||
extern UniValue zc_benchmark(const UniValue& params, bool fHelp);
|
extern UniValue zc_benchmark(const UniValue& params, bool fHelp);
|
||||||
|
|
Loading…
Reference in New Issue