Merge pull request #2852 from petertodd/getblock-chainwork
Add 'chainwork' to getblock
This commit is contained in:
commit
750ae29664
1 changed files with 1 additions and 0 deletions
|
@ -62,6 +62,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex)
|
||||||
result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce));
|
result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce));
|
||||||
result.push_back(Pair("bits", HexBits(block.nBits)));
|
result.push_back(Pair("bits", HexBits(block.nBits)));
|
||||||
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
|
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
|
||||||
|
result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex()));
|
||||||
|
|
||||||
if (blockindex->pprev)
|
if (blockindex->pprev)
|
||||||
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
|
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
|
||||||
|
|
Loading…
Reference in a new issue