getblockstats RPC command has issues #19885

issue denis2342 openend this issue on September 5, 2020
  1. denis2342 commented at 5:38 pm on September 5, 2020: none

    the command “bitcoin-cli getblockstats 0000000000000000000c61ff8f761ce509fc8901d3c22d61fec89637042ea2ba” does not work.

    It displays “error: Error parsing JSON:0000000000000000000c61ff8f761ce509fc8901d3c22d61fec89637042ea2ba”

    but it should display the block stats like the documentation says.

    also bitcoin-cli getblockstats 0 does not work. block number must be at least 1 to work. But blocks start at 0.

    tested with 0.20.1 on freebsd, another user on IRC acknowledged the problem.

  2. denis2342 added the label Bug on Sep 5, 2020
  3. n-thumann commented at 6:33 pm on September 5, 2020: contributor
    bitcoin-cli getblockstats '"0000000000000000000c61ff8f761ce509fc8901d3c22d61fec89637042ea2ba"'(notice the quotation marks) should work :) bitcoin-cli getblockstats 0 doesn´t work for me either 🤔
  4. fjahr commented at 10:27 pm on September 5, 2020: contributor
    Thanks for reporting this. The JSON parsing error is expected and @n-thumann shows how it should be formatted. I pushed a fix for the block height 0 issue in #19888.
  5. denis2342 commented at 4:25 pm on September 11, 2020: none
    but the quotation marks for getblockstats are inconsistent with the other commands, this is very irritating.
  6. fjahr commented at 11:20 pm on September 12, 2020: contributor

    but the quotation marks for getblockstats are inconsistent with the other commands, this is very irritating.

    I see what you mean. This is not an issue with this RPC in particular but with the bitcoin-cli itself. There is one approach to fix this pending here: #15448 but it seems to have stalled for over a year now. I have opened a fix using an alternative approach here #19949 which might be favored more by reviewers.

  7. achow101 closed this on Dec 5, 2022

  8. bitcoin locked this on Dec 5, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me