Page MenuHomePhabricator

Add window final block height to getchaintxstats
ClosedPublic

Authored by PiRK on Oct 15 2020, 06:27.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC808603ccd7d7: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable