MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / getfinalizedblockhash

Function getfinalizedblockhash

src/rpc/blockchain.cpp:701–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701UniValue 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
721static UniValue getblockheader(const JSONRPCRequest& request)
722{

Callers

nothing calls this directly

Calls 7

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
GetFinalizedBlockFunction · 0.85
UniValueClass · 0.70
sizeMethod · 0.45
GetHexMethod · 0.45
GetBlockHashMethod · 0.45

Tested by

no test coverage detected