Browse Source

Deprecate RPC getblocknumber

This RPC is exactly identical to getblockcount.  This duplication
dates back to commit 22f721dbf2 when
Satoshi created the RPC interface.

There's no need to have both, so we standardize on "count" which
matches the naming convention in getconnectioncount.

Following the tradition established with previously deprecated APIs,
getblocknumber continues to work, but it's not listed in the help
system.
0.8
Michael Hendricks 13 years ago
parent
commit
29c8b9416d
  1. 6
      src/bitcoinrpc.cpp

6
src/bitcoinrpc.cpp

@ -126,6 +126,7 @@ Value help(const Array& params, bool fHelp) @@ -126,6 +126,7 @@ Value help(const Array& params, bool fHelp)
// We already filter duplicates, but these deprecated screw up the sort order
if (strMethod == "getamountreceived" ||
strMethod == "getallreceived" ||
strMethod == "getblocknumber" || // deprecated
(strMethod.find("label") != string::npos))
continue;
if (strCommand != "" && strMethod != strCommand)
@ -178,12 +179,13 @@ Value getblockcount(const Array& params, bool fHelp) @@ -178,12 +179,13 @@ Value getblockcount(const Array& params, bool fHelp)
}
// deprecated
Value getblocknumber(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getblocknumber\n"
"Returns the block number of the latest block in the longest block chain.");
"Deprecated. Use getblockcount.");
return nBestHeight;
}
@ -1858,7 +1860,7 @@ string pAllowInSafeMode[] = @@ -1858,7 +1860,7 @@ string pAllowInSafeMode[] =
"help",
"stop",
"getblockcount",
"getblocknumber",
"getblocknumber", // deprecated
"getconnectioncount",
"getdifficulty",
"getgenerate",

Loading…
Cancel
Save