aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hendricks <michael@ndrix.org>2011-11-10 17:10:32 -0700
committerMichael Hendricks <michael@ndrix.org>2011-11-11 10:13:36 -0700
commit29c8b9416dc0a021ce4f27eadb88a0de98d7418e (patch)
tree0feaa3b8422d2a49ac462a6f04cd514bddde96b9
parent5efee7da866fd6ec9cbf059f253d6d98964bd817 (diff)
Deprecate RPC getblocknumber
This RPC is exactly identical to getblockcount. This duplication dates back to commit 22f721dbf23cf5ce9e3ded9bcfb65a3894cc0f8c 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.
-rw-r--r--src/bitcoinrpc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 6e2eac5a7e..a7ffe14e0c 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -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)
}
+// 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[] =
"help",
"stop",
"getblockcount",
- "getblocknumber",
+ "getblocknumber", // deprecated
"getconnectioncount",
"getdifficulty",
"getgenerate",