Inconsistent RPC boolean validation #9802

issue rock217 opened this issue on February 19, 2017
  1. rock217 commented at 5:59 PM on February 19, 2017: none

    Describe the issue

    There is a lack of consistency with RPC boolean parameter validation. Sometimes 1 == true, sometimes 1 returns an error, sometimes true==true, sometimes true returns an error.

    Can you reliably reproduce the issue?

    If so, please list the steps to reproduce below:

    1. bitcoin-cli getrawmempool 1
    2. bitcoin-cli getrawmempool true
    3. getrawtransaction sometxid 1
    4. getrawtransaction sometxid true

    Expected behaviour

    Consistent behavior or type juggling so they both equate true.

    Actual behaviour

    1. bitcoin-cli getrawmempool 1 //JSON value is not a boolean as expected
    2. bitcoin-cli getrawmempool true //works
    3. getrawtransaction sometxid 1 //works
    4. getrawtransaction sometxid true //JSON value is not an integer as expected

    What version of bitcoin-core are you using?

    0.13.2

    Machine specs:

    • OS: Ubuntu 16.04
    • CPU: x86_64
    • RAM: 4GB
    • Disk size: 256GB
    • Disk Type (HD/SDD): SSD
  2. fanquake added the label RPC/REST/ZMQ on Feb 20, 2017
  3. laanwj commented at 3:13 PM on February 21, 2017: member

    The getrawtransaction case was fixed in #9025. It will still accept integers for backwards compatibility, but booleans as well. This is part of the 0.14 release.

  4. laanwj closed this on Feb 21, 2017

  5. DrahtBot locked this on Dec 16, 2021
Contributors

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