| 699 | } |
| 700 | |
| 701 | UniValue getfinalizedblockhash(const JSONRPCRequest &request) { |
| 702 | if (request.fHelp || request.params.size() != 0) |
| 703 | throw std::runtime_error( |
| 704 | "getfinalizedblockhash\n" |
| 705 | "\nReturns the hash of the currently finalized block.\n" |
| 706 | "\nResult:\n" |
| 707 | "\"hex\" (string) the block hash hex encoded\n" |
| 708 | "\nExamples:\n" |
| 709 | + HelpExampleCli("getfinalizedblockhash", "") |
| 710 | + HelpExampleRpc("getfinalizedblockhash", "") |
| 711 | ); |
| 712 | |
| 713 | LOCK(cs_main); |
| 714 | const CBlockIndex *blockIndexFinalized = GetFinalizedBlock(); |
| 715 | if (blockIndexFinalized) { |
| 716 | return blockIndexFinalized->GetBlockHash().GetHex(); |
| 717 | } |
| 718 | return UniValue(UniValue::VSTR); |
| 719 | } |
| 720 | |
| 721 | static UniValue getblockheader(const JSONRPCRequest& request) |
| 722 | { |
nothing calls this directly
no test coverage detected