@@ -105,6 +105,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
105
105
result.push_back (Pair (" bits" , strprintf (" %08x" , blockindex->nBits )));
106
106
result.push_back (Pair (" difficulty" , GetDifficulty (blockindex)));
107
107
result.push_back (Pair (" chainwork" , blockindex->nChainWork .GetHex ()));
108
+ result.push_back (Pair (" nTx" , (uint64_t )blockindex->nTx ));
108
109
109
110
if (blockindex->pprev )
110
111
result.push_back (Pair (" previousblockhash" , blockindex->pprev ->GetBlockHash ().GetHex ()));
@@ -150,6 +151,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx
150
151
result.push_back (Pair (" bits" , strprintf (" %08x" , block.nBits )));
151
152
result.push_back (Pair (" difficulty" , GetDifficulty (blockindex)));
152
153
result.push_back (Pair (" chainwork" , blockindex->nChainWork .GetHex ()));
154
+ result.push_back (Pair (" nTx" , (uint64_t )blockindex->nTx ));
153
155
154
156
if (blockindex->pprev )
155
157
result.push_back (Pair (" previousblockhash" , blockindex->pprev ->GetBlockHash ().GetHex ()));
@@ -679,6 +681,7 @@ UniValue getblockheader(const JSONRPCRequest& request)
679
681
" \" bits\" : \" 1d00ffff\" , (string) The bits\n "
680
682
" \" difficulty\" : x.xxx, (numeric) The difficulty\n "
681
683
" \" chainwork\" : \" 0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n "
684
+ " \" nTx\" : n, (numeric) The number of transactions in the block.\n "
682
685
" \" previousblockhash\" : \" hash\" , (string) The hash of the previous block\n "
683
686
" \" nextblockhash\" : \" hash\" , (string) The hash of the next block\n "
684
687
" }\n "
@@ -748,6 +751,7 @@ UniValue getblock(const JSONRPCRequest& request)
748
751
" \" bits\" : \" 1d00ffff\" , (string) The bits\n "
749
752
" \" difficulty\" : x.xxx, (numeric) The difficulty\n "
750
753
" \" chainwork\" : \" xxxx\" , (string) Expected number of hashes required to produce the chain up to this block (in hex)\n "
754
+ " \" nTx\" : n, (numeric) The number of transactions in the block.\n "
751
755
" \" previousblockhash\" : \" hash\" , (string) The hash of the previous block\n "
752
756
" \" nextblockhash\" : \" hash\" (string) The hash of the next block\n "
753
757
" }\n "
0 commit comments