mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 12:55:02 +02:00
rpc: add target and bits to getchainstates
This commit is contained in:
@@ -3308,6 +3308,8 @@ static RPCHelpMan loadtxoutset()
|
||||
const std::vector<RPCResult> RPCHelpForChainstate{
|
||||
{RPCResult::Type::NUM, "blocks", "number of blocks in this chainstate"},
|
||||
{RPCResult::Type::STR_HEX, "bestblockhash", "blockhash of the tip"},
|
||||
{RPCResult::Type::STR_HEX, "bits", "nBits: compact representation of the block difficulty target"},
|
||||
{RPCResult::Type::STR_HEX, "target", "The difficulty target"},
|
||||
{RPCResult::Type::NUM, "difficulty", "difficulty of the tip"},
|
||||
{RPCResult::Type::NUM, "verificationprogress", "progress towards the network tip"},
|
||||
{RPCResult::Type::STR_HEX, "snapshot_blockhash", /*optional=*/true, "the base block of the snapshot this chainstate is based on, if any"},
|
||||
@@ -3350,6 +3352,8 @@ return RPCHelpMan{
|
||||
|
||||
data.pushKV("blocks", (int)chain.Height());
|
||||
data.pushKV("bestblockhash", tip->GetBlockHash().GetHex());
|
||||
data.pushKV("bits", strprintf("%08x", tip->nBits));
|
||||
data.pushKV("target", GetTarget(*tip, chainman.GetConsensus().powLimit).GetHex());
|
||||
data.pushKV("difficulty", GetDifficulty(*tip));
|
||||
data.pushKV("verificationprogress", chainman.GuessVerificationProgress(tip));
|
||||
data.pushKV("coins_db_cache_bytes", cs.m_coinsdb_cache_size_bytes);
|
||||
|
||||
Reference in New Issue
Block a user