Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
{}, | {}, | ||||
RPCResult{"\"hex\" (string) the block hash hex-encoded\n"}, | RPCResult{"\"hex\" (string) the block hash hex-encoded\n"}, | ||||
RPCExamples{HelpExampleCli("getfinalizedblockhash", "") + | RPCExamples{HelpExampleCli("getfinalizedblockhash", "") + | ||||
HelpExampleRpc("getfinalizedblockhash", "")}, | HelpExampleRpc("getfinalizedblockhash", "")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
const CBlockIndex *blockIndexFinalized = GetFinalizedBlock(); | const CBlockIndex *blockIndexFinalized = | ||||
::ChainstateActive().GetFinalizedBlock(); | |||||
if (blockIndexFinalized) { | if (blockIndexFinalized) { | ||||
return blockIndexFinalized->GetBlockHash().GetHex(); | return blockIndexFinalized->GetBlockHash().GetHex(); | ||||
} | } | ||||
return UniValue(UniValue::VSTR); | return UniValue(UniValue::VSTR); | ||||
} | } | ||||
void RPCNotifyBlockChange(bool ibd, const CBlockIndex *pindex) { | void RPCNotifyBlockChange(bool ibd, const CBlockIndex *pindex) { | ||||
if (pindex) { | if (pindex) { | ||||
▲ Show 20 Lines • Show All 2,461 Lines • Show Last 20 Lines |