From 091aa8dae9b7345a1cd81e2733766463dfbf4b82 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 3 Jul 2013 11:02:29 -0400 Subject: RPC: add getbestblockhash, to return tip of best chain --- src/rpcblockchain.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/rpcblockchain.cpp') diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 3c24016fe..edaa73222 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) { -- cgit v1.2.3