getblockstats run with no special aguments either works or doesn't work without txindex enabled, based on what block you call it on #14499

issue gmaxwell opened this issue on October 16, 2018
  1. gmaxwell commented at 11:26 PM on October 16, 2018: contributor

    [gmaxwell@argonaut src]$ ./bitcoin-cli getblockstats 101 { "avgfee": 0, "avgfeerate": 0, "avgtxsize": 0, "blockhash": "00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984", "feerate_percentiles": [ 0, 0, 0, 0, 0 ], "height": 101, "ins": 0, "maxfee": 0, "maxfeerate": 0, "maxtxsize": 0, "medianfee": 0, "mediantime": 1231657185, "mediantxsize": 0, "minfee": 0, "minfeerate": 0, "mintxsize": 0, "outs": 1, "subsidy": 5000000000, "swtotal_size": 0, "swtotal_weight": 0, "swtxs": 0, "time": 1231661741, "total_out": 0, "total_size": 0, "total_weight": 0, "totalfee": 0, "txs": 1, "utxo_increase": 1, "utxo_size_inc": 117 } [gmaxwell@argonaut src]$ ./bitcoin-cli getblockstats 100000 error code: -8 error message: One or more of the selected stats requires -txindex enabled

    Stats that require txindex should always fail if txindex isn't enabled and the stat is requested, and those stats should not be offered by default.

    Also, although the help says it will accept a '1. "hash_or_height" (string or numeric, required) The block hash or height of the target block', that doesn't seem to work regardless of how I quote it.

    [gmaxwell@argonaut src]$ ./bitcoin-cli getblockstats "0000000000000000001b98c07fca289e1ca3358aeabdcca9b7f7ba704d83a3d4" error: Error parsing JSON:0000000000000000001b98c07fca289e1ca3358aeabdcca9b7f7ba704d83a3d4

  2. fanquake added the label RPC/REST/ZMQ on Oct 17, 2018
  3. promag commented at 11:18 PM on October 18, 2018: member

    @gmaxwell this works for me:

    ./src/bitcoin-cli -regtest getblockstats '"314ae89f7b1b374bf4764e9fd28df62ecfee4a4ed015c71afde9b39f2167bbee"'
    
  4. promag commented at 1:48 PM on October 19, 2018: member

    Stats that require txindex should always fail if txindex isn't enabled and the stat is requested, and those stats should not be offered by default.

    👍

  5. laanwj closed this on Oct 26, 2018

  6. laanwj referenced this in commit 9d4541508b on Oct 26, 2018
  7. Munkybooty referenced this in commit 25b8a4ea07 on Jul 21, 2021
  8. Munkybooty referenced this in commit 459cfb205b on Jul 21, 2021
  9. Munkybooty referenced this in commit 41ce116f3b on Jul 22, 2021
  10. Munkybooty referenced this in commit 8511568e10 on Jul 22, 2021
  11. Munkybooty referenced this in commit 07c0eec88c on Jul 23, 2021
  12. DrahtBot locked this on Sep 8, 2021

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: 2026-04-13 15:15 UTC

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