mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge pull request #632 from mndrix/deprecate-getblocknumber
Deprecate RPC getblocknumber
This commit is contained in:
commit
0310cd6403
1 changed files with 4 additions and 2 deletions
|
@ -126,6 +126,7 @@ Value help(const Array& params, bool fHelp)
|
||||||
// We already filter duplicates, but these deprecated screw up the sort order
|
// We already filter duplicates, but these deprecated screw up the sort order
|
||||||
if (strMethod == "getamountreceived" ||
|
if (strMethod == "getamountreceived" ||
|
||||||
strMethod == "getallreceived" ||
|
strMethod == "getallreceived" ||
|
||||||
|
strMethod == "getblocknumber" || // deprecated
|
||||||
(strMethod.find("label") != string::npos))
|
(strMethod.find("label") != string::npos))
|
||||||
continue;
|
continue;
|
||||||
if (strCommand != "" && strMethod != strCommand)
|
if (strCommand != "" && strMethod != strCommand)
|
||||||
|
@ -181,12 +182,13 @@ Value getblockcount(const Array& params, bool fHelp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// deprecated
|
||||||
Value getblocknumber(const Array& params, bool fHelp)
|
Value getblocknumber(const Array& params, bool fHelp)
|
||||||
{
|
{
|
||||||
if (fHelp || params.size() != 0)
|
if (fHelp || params.size() != 0)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"getblocknumber\n"
|
"getblocknumber\n"
|
||||||
"Returns the block number of the latest block in the longest block chain.");
|
"Deprecated. Use getblockcount.");
|
||||||
|
|
||||||
return nBestHeight;
|
return nBestHeight;
|
||||||
}
|
}
|
||||||
|
@ -1870,7 +1872,7 @@ string pAllowInSafeMode[] =
|
||||||
"help",
|
"help",
|
||||||
"stop",
|
"stop",
|
||||||
"getblockcount",
|
"getblockcount",
|
||||||
"getblocknumber",
|
"getblocknumber", // deprecated
|
||||||
"getconnectioncount",
|
"getconnectioncount",
|
||||||
"getdifficulty",
|
"getdifficulty",
|
||||||
"getgenerate",
|
"getgenerate",
|
||||||
|
|
Loading…
Add table
Reference in a new issue