Merge pull request #632 from mndrix/deprecate-getblocknumber
authorGavin Andresen <gavinandresen@gmail.com>
Mon, 21 Nov 2011 19:31:42 +0000 (11:31 -0800)
committerGavin Andresen <gavinandresen@gmail.com>
Mon, 21 Nov 2011 19:31:42 +0000 (11:31 -0800)
Deprecate RPC getblocknumber

src/bitcoinrpc.cpp

index 31ef725..2857b75 100644 (file)
@@ -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)
@@ -181,12 +182,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;
 }
@@ -1870,7 +1872,7 @@ string pAllowInSafeMode[] =
     "help",
     "stop",
     "getblockcount",
-    "getblocknumber",
+    "getblocknumber",  // deprecated
     "getconnectioncount",
     "getdifficulty",
     "getgenerate",