doc: corrected lockunspent rpc quoting #31275

pull Talej wants to merge 1 commits into bitcoin:master from Talej:listunspentrpctypo changing 3 files +7 −7
  1. Talej commented at 2:44 am on November 12, 2024: none

    bitcoin-cli help lockunspent RPC example shows:

    0As a JSON-RPC call
    1> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    Including quotes around the transactions argument. Using the RPC in this way fails:

    0curl --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"6f244af8e2162138369fc736a673f85ead59ad88fb5a1edd6e03f81b33c537b0\",\"vout\":1}]"]}' -H 'content-type: text/plain;' http://127.0.0.1:18443/wallet/locktest
    1
    2{"result":null,"error":{"code":-3,"message":"Expected type array, got string"},"id":"curltest"}
    

    This change corrects the documentation to remove the additional quotes so the example works as intended:

    0curl --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "lockunspent", "params": [false, [{"txid":"6f244af8e2162138369fc736a673f85ead59ad88fb5a1edd6e03f81b33c537b0","vout":0}]]}' -H 'content-type: text/plain;' http://127.0.0.1:18443/wallet/locktest
    1
    2{"result":true,"error":null,"id":"curltest"}
    
  2. DrahtBot commented at 2:44 am on November 12, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31275.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK rkrux, achow101
    Concept NACK sipa
    Stale ACK luke-jr

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #24539 (Add a “tx output spender” index by sstone)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Docs on Nov 12, 2024
  4. Talej marked this as ready for review on Nov 12, 2024
  5. Talej renamed this:
    doc: corrected listunspent rpc quoting
    doc: corrected lockunspent rpc quoting
    on Nov 12, 2024
  6. Talej force-pushed on Nov 12, 2024
  7. Madxgame approved
  8. fanquake commented at 9:54 am on November 12, 2024: member
    The same kind of quoting is used in multiple places in this file, so if it is incorrect / needs updating, all instances should be changed at the same time.
  9. Talej commented at 3:58 am on November 13, 2024: none

    Corrected additional RPC examples for gettxspendingprevout, createrawtransaction, signrawtransactionwithkey, addmultisigaddress & listunspent

    All relevant changes should be complete here

  10. luke-jr approved
  11. luke-jr commented at 8:02 pm on January 8, 2025: member

    Commit messages leave a bit to be desired, but the code and output looks correct

    crACK 1f3f5c049b4080ecaf30604fd22d65aa0fc4af45

  12. fanquake commented at 5:35 pm on February 20, 2025: member
    Please squash your commits. You can improve the commit message at the same time. i.e “doc: ….”
  13. luke-jr referenced this in commit 599a0811ac on Feb 22, 2025
  14. luke-jr referenced this in commit 2f7f2fae63 on Feb 22, 2025
  15. Talej force-pushed on Feb 27, 2025
  16. Talej commented at 7:09 am on February 27, 2025: none

    Please squash your commits. You can improve the commit message at the same time. i.e “doc: ….”

    Done!

  17. DrahtBot added the label Needs rebase on May 7, 2025
  18. fanquake commented at 11:51 am on May 13, 2025: member
    @Talej Can you rebase this?
  19. doc: corrected lockunspent, gettxspendingprevout, createrawtransaction, signrawtransactionwithkey & listunspent rpc quoting 7e93e29259
  20. Talej force-pushed on May 17, 2025
  21. DrahtBot removed the label Needs rebase on May 17, 2025
  22. Talej commented at 9:04 am on May 17, 2025: none

    @Talej Can you rebase this?

    All done!

  23. achow101 requested review from sipa on Oct 22, 2025
  24. achow101 requested review from achow101 on Oct 22, 2025
  25. achow101 requested review from murchandamus on Oct 22, 2025
  26. achow101 requested review from sr-gi on Oct 22, 2025
  27. achow101 requested review from danielabrozzoni on Oct 22, 2025
  28. achow101 commented at 5:46 pm on October 27, 2025: member

    ACK 7e93e2925981c78c17a3deb2f6e6a16fa56730c4

    Edit: Retracting ack, agree with #31275 (comment)

  29. DrahtBot requested review from luke-jr on Oct 27, 2025
  30. rkrux approved
  31. rkrux commented at 2:17 pm on November 3, 2025: contributor

    crACK 7e93e2925981c78c17a3deb2f6e6a16fa56730c4

    Can update the PR title now that more RPCs are updated.

  32. sipa commented at 11:23 pm on November 10, 2025: member

    I wanted to verify if all invocations of HelpExampleRpc produce valid JSON, so I tested by adding a UniValue::read inside the function. The following RPCs all fail it still (with this PR):

    • getblockfrompeer
    • importmempool
    • getindexinfo
    • addnode
    • addconnection
    • sendmsgtopeer
    • createwalletdescriptor
    • restorewallet
    • listlabels
    • loadwallet
    • unloadwallet

    I think this means we either need to:

    • Get rid of the curl example codes in the RPC help texts entirely, or
    • Add testing to actually enforce they’re correct.
  33. sipa commented at 3:06 pm on December 8, 2025: member

    Weak Concept NACK.

    Given how broken the examples are, I think we should fix them throughout and add testing to prevent regressions, or get rid of them entirely.

  34. sipa removed review request from sipa on Dec 11, 2025
  35. DrahtBot added the label Needs rebase on Feb 20, 2026
  36. DrahtBot commented at 8:55 am on February 20, 2026: contributor
    🐙 This pull request conflicts with the target branch and needs rebase.
  37. sedited commented at 6:24 pm on March 14, 2026: contributor

    There’s been no comment from the author here in a while and given the NACK, I don’t think reviewers are likely to still approve this change. A comprehensive solution also seems better to me. The formatting pretty much never changes, so a linter could maybe be implemented for that?

    The PR hasn’t made progress, so I am going to close this. Feel free to open another PR that takes the review comments into consideration.

  38. sedited closed this on Mar 14, 2026


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-03 00:13 UTC

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