HomePhabricator

Add window final block height to getchaintxstats

Description

Add window final block height to getchaintxstats

Summary:

This patch is motivated by the desire to make the output of getchaintxstats more useful and optimized for applications to consume and render the data.
Firstly, this data is already available to the RPC, no additional work is done. Currently additional RPC calls will be needed to look up the height of the final block in the window or the block height that began the window.
By adding the block height of the final block in the window, the JSON is "self-contained" and applications can calculate the exact block height range of the window with no additional RPC requests.
For example, a web application which wants to render historical information for getchaintxstats RPC on various window sizes might call the RPC with various window lengths, once per day, and store the JSON results somewhere. Because the final block height of each dataset is included, it's no extra work to determine the exact block window range of each JSON response.

Backport of Core PR16695

Test Plan:

ninja && ninja check
bitcoin-cli getchaintxstats

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7928

Details

Provenance
Jonathan "Duke" Leto <jonathan@leto.net>Authored on Oct 15 2020, 08:14
PiRKCommitted on Oct 15 2020, 08:14
abc-botPushed on Oct 15 2020, 08:19
Reviewer
Restricted Owners Package
Differential Revision
D7928: Add window final block height to getchaintxstats
Parents
rABC9261e048c79f: [backport#14879]Add warning messages to the debug window
Branches
Unknown
Tags
Unknown