rpc: argument name inconsistency #19616

issue stylesuxx opened this issue on July 28, 2020
  1. stylesuxx commented at 9:13 PM on July 28, 2020: contributor

    Most of the rpc commands that take a number of blocks as an argument have an argument name of nblocks, like:

    • getchaintxstats
    • verifychain
    • generatetoaddress
    • getnetworkhashps
    • ...

    but generatetodescriptor instead has an argument name of num_blocks.

    Not sure if I am being to pedantic here, but I'll happily provide a PR.

  2. MarcoFalke commented at 4:30 AM on July 29, 2020: member

    Changing the naming would be a breaking change

  3. fanquake added the label RPC/REST/ZMQ on Jul 29, 2020
  4. stylesuxx commented at 8:26 AM on July 29, 2020: contributor

    @MarcoFalke - I am not sure if I understand why it would be a breaking change - maybe I was not completely clear: https://github.com/bitcoin/bitcoin/blob/2f71a1ea35667b3873197201531e7ae198ec5bf4/src/rpc/mining.cpp#L209 vs. https://github.com/bitcoin/bitcoin/blob/2f71a1ea35667b3873197201531e7ae198ec5bf4/src/rpc/mining.cpp#L244

    Within the code itself both methods use num_blocks, which can stay as it is. And the RPC arguments are all positional, not named - right?

  5. MarcoFalke commented at 9:02 AM on July 29, 2020: member

    Both, positional as well as named args are supported

  6. stylesuxx commented at 9:05 AM on July 29, 2020: contributor

    Oh, I missed that. Then of course it makes no sense to change that.

  7. jonatack commented at 9:08 AM on July 29, 2020: member

    Yes, RPC API changes usually need to go through a deprecation process. Run git log -S deprecat for an idea.

  8. stylesuxx commented at 9:14 AM on July 29, 2020: contributor

    I see, thanks for the heads up, I guess this issue can be closed then.

  9. fanquake closed this on Jul 29, 2020

  10. DrahtBot locked this on Feb 15, 2022

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:14 UTC

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