-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RPC] add 'getblockindexstats' function #911
[RPC] add 'getblockindexstats' function #911
Conversation
Concept ACK Would love to see this covered in a functional test and possibly brought over to the REST API at some point. Will give it some testing soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some nits in the RPC command help texts. not a big deal, and not the only ones that have styling inconsistencies overall. Can be fixed in a separate PR that unifies all RPC command help texts.
for reference, the formatting should be
"command \"required_string_args\" required_numbool_args ( \"optional_string_args\" optional_numbool_args )\n"
Fixed help texts styling |
- getblockindexstats - getmintsinblocks - getserials
7c2c31f
to
49ef846
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK. I have a few remarks about the locking strategy.
1598635
to
929c81b
Compare
- validaterange - getfeeinfo - geblockindexstats - getmintsinblocks - getserials
929c81b
to
eea9915
Compare
Locking strategy has been updated guarding only the access to chainActive.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK eea9915
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK eea9915
eea9915 [RPC] fix locking strategy (random-zebra) 49ef846 [RPC] fix help texts (random-zebra) 26b1f0c [RPC] 'getblockindexstats': count public spends separately (random-zebra) 7980f23 [RPC] fix fee calculation in 'getblockindexstats' and 'getfeeinfo' (random-zebra) 689ac23 [RPC] add 'getblockindexstats' function (random-zebra) Pull request description: This introduces a new RPC method `getblockindexstats` to get aggregated BlockIndex data for a range of blocks: - transaction count - transaction count (including coinbase/coinstake txes) - zPIV per-denom mint count - zPIV per-denom spend count - total transaction bytes - total fees in block range - average fee per kB Since it expands the functionality of `getfeeinfo`, this method has been redirected to call `getblockindexstats` (over the **last** N blocks). To avoid code duplication with `getserials` and `getmintsinblocks`, the initial validation of the input params has been refactored in the function `validaterange()`. This also contains a fix to prevent the wallet from crashing when calling these functions over out-of-range blocks. ACKs for commit eea991: Fuzzbawls: ACK eea9915 Warrows: ACK eea9915 Tree-SHA512: fd424d27b09133f8e1b646044f6e48cb7be8e7b7f6bbe51797b229e7e1c5d721226022915876d3810b38e7c2eb6bb089a7e3b8df2b0487ac251bde405e1f964a
This introduces a new RPC method
getblockindexstats
to get aggregated BlockIndex data for a range of blocks:Since it expands the functionality of
getfeeinfo
, this method has been redirected to callgetblockindexstats
(over the last N blocks).To avoid code duplication with
getserials
andgetmintsinblocks
, the initial validation of the input params has been refactored in the functionvalidaterange()
.This also contains a fix to prevent the wallet from crashing when calling these functions over out-of-range blocks.