|
|
|
@ -105,6 +105,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
@@ -105,6 +105,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
|
|
|
|
|
result.push_back(Pair("bits", strprintf("%08x", blockindex->nBits))); |
|
|
|
|
result.push_back(Pair("difficulty", GetDifficulty(blockindex))); |
|
|
|
|
result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); |
|
|
|
|
result.push_back(Pair("nTx", (uint64_t)blockindex->nTx)); |
|
|
|
|
|
|
|
|
|
if (blockindex->pprev) |
|
|
|
|
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex())); |
|
|
|
@ -150,6 +151,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx
@@ -150,6 +151,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx
|
|
|
|
|
result.push_back(Pair("bits", strprintf("%08x", block.nBits))); |
|
|
|
|
result.push_back(Pair("difficulty", GetDifficulty(blockindex))); |
|
|
|
|
result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); |
|
|
|
|
result.push_back(Pair("nTx", (uint64_t)blockindex->nTx)); |
|
|
|
|
|
|
|
|
|
if (blockindex->pprev) |
|
|
|
|
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex())); |
|
|
|
@ -679,6 +681,7 @@ UniValue getblockheader(const JSONRPCRequest& request)
@@ -679,6 +681,7 @@ UniValue getblockheader(const JSONRPCRequest& request)
|
|
|
|
|
" \"bits\" : \"1d00ffff\", (string) The bits\n" |
|
|
|
|
" \"difficulty\" : x.xxx, (numeric) The difficulty\n" |
|
|
|
|
" \"chainwork\" : \"0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n" |
|
|
|
|
" \"nTx\" : n, (numeric) The number of transactions in the block.\n" |
|
|
|
|
" \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n" |
|
|
|
|
" \"nextblockhash\" : \"hash\", (string) The hash of the next block\n" |
|
|
|
|
"}\n" |
|
|
|
@ -748,6 +751,7 @@ UniValue getblock(const JSONRPCRequest& request)
@@ -748,6 +751,7 @@ UniValue getblock(const JSONRPCRequest& request)
|
|
|
|
|
" \"bits\" : \"1d00ffff\", (string) The bits\n" |
|
|
|
|
" \"difficulty\" : x.xxx, (numeric) The difficulty\n" |
|
|
|
|
" \"chainwork\" : \"xxxx\", (string) Expected number of hashes required to produce the chain up to this block (in hex)\n" |
|
|
|
|
" \"nTx\" : n, (numeric) The number of transactions in the block.\n" |
|
|
|
|
" \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n" |
|
|
|
|
" \"nextblockhash\" : \"hash\" (string) The hash of the next block\n" |
|
|
|
|
"}\n" |
|
|
|
|