@@ -95,6 +95,7 @@ UniValue blockheaderToJSON(const CBlockIndex* blockindex)
95
95
result.pushKV (" bits" , strprintf (" %08x" , blockindex->nBits ));
96
96
result.pushKV (" difficulty" , GetDifficulty (blockindex));
97
97
result.pushKV (" chainwork" , blockindex->nChainWork .GetHex ());
98
+ result.pushKV (" nTx" , (uint64_t )blockindex->nTx );
98
99
99
100
if (blockindex->pprev )
100
101
result.pushKV (" previousblockhash" , blockindex->pprev ->GetBlockHash ().GetHex ());
@@ -140,6 +141,7 @@ UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool tx
140
141
result.pushKV (" bits" , strprintf (" %08x" , block.nBits ));
141
142
result.pushKV (" difficulty" , GetDifficulty (blockindex));
142
143
result.pushKV (" chainwork" , blockindex->nChainWork .GetHex ());
144
+ result.pushKV (" nTx" , (uint64_t )blockindex->nTx );
143
145
144
146
if (blockindex->pprev )
145
147
result.pushKV (" previousblockhash" , blockindex->pprev ->GetBlockHash ().GetHex ());
@@ -694,6 +696,7 @@ static UniValue getblockheader(const JSONRPCRequest& request)
694
696
" \" bits\" : \" 1d00ffff\" , (string) The bits\n "
695
697
" \" difficulty\" : x.xxx, (numeric) The difficulty\n "
696
698
" \" chainwork\" : \" 0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n "
699
+ " \" nTx\" : n, (numeric) The number of transactions in the block.\n "
697
700
" \" previousblockhash\" : \" hash\" , (string) The hash of the previous block\n "
698
701
" \" nextblockhash\" : \" hash\" , (string) The hash of the next block\n "
699
702
" }\n "
@@ -782,6 +785,7 @@ static UniValue getblock(const JSONRPCRequest& request)
782
785
" \" bits\" : \" 1d00ffff\" , (string) The bits\n "
783
786
" \" difficulty\" : x.xxx, (numeric) The difficulty\n "
784
787
" \" chainwork\" : \" xxxx\" , (string) Expected number of hashes required to produce the chain up to this block (in hex)\n "
788
+ " \" nTx\" : n, (numeric) The number of transactions in the block.\n "
785
789
" \" previousblockhash\" : \" hash\" , (string) The hash of the previous block\n "
786
790
" \" nextblockhash\" : \" hash\" (string) The hash of the next block\n "
787
791
" }\n "
0 commit comments