aboutsummaryrefslogtreecommitdiff
path: root/src/rpcblockchain.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2013-07-03 11:02:29 -0400
committerJeff Garzik <jgarzik@bitpay.com>2013-07-03 11:02:29 -0400
commit091aa8dae9b7345a1cd81e2733766463dfbf4b82 (patch)
tree1f8c22922846c5e6b1a77a1312253b5467c1d357 /src/rpcblockchain.cpp
parent6e802ac85d2732ab3dd83e299422d544476de6a1 (diff)
RPC: add getbestblockhash, to return tip of best chain
Diffstat (limited to 'src/rpcblockchain.cpp')
-rw-r--r--src/rpcblockchain.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp
index 3c24016fe3..edaa732225 100644
--- a/src/rpcblockchain.cpp
+++ b/src/rpcblockchain.cpp
@@ -82,6 +82,15 @@ Value getblockcount(const Array& params, bool fHelp)
return nBestHeight;
}
+Value getbestblockhash(const Array& params, bool fHelp)
+{
+ if (fHelp || params.size() != 0)
+ throw runtime_error(
+ "getbestblockhash\n"
+ "Returns the hash of the best (tip) block in the longest block chain.");
+
+ return hashBestChain.GetHex();
+}
Value getdifficulty(const Array& params, bool fHelp)
{