mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
RPC: add getbestblockhash, to return tip of best chain
This commit is contained in:
parent
6e802ac85d
commit
091aa8dae9
3 changed files with 11 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue