From 1b3656d50bda646822fd954714a88dea1528548b Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Wed, 24 Jul 2013 01:58:23 -0400 Subject: [PATCH] Add 'chainwork' to getblock Returns nChainWork from the block index, the total work done by all blocks since the genesis block. --- src/rpcblockchain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index edaa732225..ba346f19d9 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -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("bits", HexBits(block.nBits))); result.push_back(Pair("difficulty", GetDifficulty(blockindex))); + result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex())); if (blockindex->pprev) result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));