aboutsummaryrefslogtreecommitdiff
path: root/src/rpcblockchain.cpp
diff options
context:
space:
mode:
authorJeff Garzik <[email protected]>2013-07-10 08:49:50 -0700
committerJeff Garzik <[email protected]>2013-07-10 08:49:50 -0700
commit3b837d5679af0c54ef2cef233cf42c09cdc50926 (patch)
tree0781d8fe4e04dce855797b98d41a970eed740c61 /src/rpcblockchain.cpp
parentMerge pull request #2820 from fanquake/remove-readme-rst (diff)
parentRPC: add getbestblockhash, to return tip of best chain (diff)
downloaddiscoin-3b837d5679af0c54ef2cef233cf42c09cdc50926.tar.xz
discoin-3b837d5679af0c54ef2cef233cf42c09cdc50926.zip
Merge pull request #2812 from jgarzik/rpcbestblock
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 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)
{