RPC: add getbestblockhash, to return tip of best chain

This commit is contained in:
Jeff Garzik
2013-07-03 11:02:29 -04:00
parent 6e802ac85d
commit 091aa8dae9
3 changed files with 11 additions and 0 deletions

View File

@@ -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)
{