Make applicable only on mainnet

This commit is contained in:
Jay Graber 2018-01-17 01:25:58 -08:00
parent 9d2974ed5b
commit df46562f26
1 changed files with 4 additions and 4 deletions

View File

@ -401,10 +401,11 @@ static UniValue GetNetworksInfo()
UniValue getdeprecationinfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
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.\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"
@ -416,9 +417,8 @@ UniValue getdeprecationinfo(const UniValue& params, bool fHelp)
+ HelpExampleRpc("getdeprecationinfo", "")
);
UniValue obj(UniValue::VOBJ);
obj.push_back(Pair("version", CLIENT_VERSION));
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));