File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change
1
+ Updated RPCs
2
+ ------------
3
+
4
+ - The ` getchaintxstats ` RPC now returns the additional key of
5
+ ` window_final_block_height ` .
Original file line number Diff line number Diff line change @@ -1639,6 +1639,7 @@ static UniValue getchaintxstats(const JSONRPCRequest& request)
1639
1639
" \" time\" : xxxxx, (numeric) The timestamp for the final block in the window in UNIX format.\n "
1640
1640
" \" txcount\" : xxxxx, (numeric) The total number of transactions in the chain up to that point.\n "
1641
1641
" \" window_final_block_hash\" : \" ...\" , (string) The hash of the final block in the window.\n "
1642
+ " \" window_final_block_height\" : xxxxx, (numeric) The height of the final block in the window.\n "
1642
1643
" \" window_block_count\" : xxxxx, (numeric) Size of the window in number of blocks.\n "
1643
1644
" \" window_tx_count\" : xxxxx, (numeric) The number of transactions in the window. Only returned if \" window_block_count\" is > 0.\n "
1644
1645
" \" window_interval\" : xxxxx, (numeric) The elapsed time in the window in seconds. Only returned if \" window_block_count\" is > 0.\n "
@@ -1689,6 +1690,7 @@ static UniValue getchaintxstats(const JSONRPCRequest& request)
1689
1690
ret.pushKV (" time" , (int64_t )pindex->nTime );
1690
1691
ret.pushKV (" txcount" , (int64_t )pindex->nChainTx );
1691
1692
ret.pushKV (" window_final_block_hash" , pindex->GetBlockHash ().GetHex ());
1693
+ ret.pushKV (" window_final_block_height" , pindex->nHeight );
1692
1694
ret.pushKV (" window_block_count" , blockcount);
1693
1695
if (blockcount > 0 ) {
1694
1696
ret.pushKV (" window_tx_count" , nTxDiff);
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ def _test_getchaintxstats(self):
186
186
assert_equal (chaintxstats ['time' ], b200 ['time' ])
187
187
assert_equal (chaintxstats ['txcount' ], 201 )
188
188
assert_equal (chaintxstats ['window_final_block_hash' ], b200_hash )
189
+ assert_equal (chaintxstats ['window_final_block_height' ], 200 )
189
190
assert_equal (chaintxstats ['window_block_count' ], 199 )
190
191
assert_equal (chaintxstats ['window_tx_count' ], 199 )
191
192
assert_equal (chaintxstats ['window_interval' ], time_diff )
@@ -195,6 +196,7 @@ def _test_getchaintxstats(self):
195
196
assert_equal (chaintxstats ['time' ], b1 ['time' ])
196
197
assert_equal (chaintxstats ['txcount' ], 2 )
197
198
assert_equal (chaintxstats ['window_final_block_hash' ], b1_hash )
199
+ assert_equal (chaintxstats ['window_final_block_height' ], 1 )
198
200
assert_equal (chaintxstats ['window_block_count' ], 0 )
199
201
assert 'window_tx_count' not in chaintxstats
200
202
assert 'window_interval' not in chaintxstats
You can’t perform that action at this time.
0 commit comments