rpc: Make verifychain default values static, not depend on global args #18541

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2004-rpcStaticDefaults changing 1 files +6 −11
  1. MarcoFalke commented at 4:55 PM on April 6, 2020: member

    This fixes several issues:

    • The documentation is not compile-time static and depends on run-time arguments, making it impossible to host it on a static resource like a website or pdf. See also a similar change in the wallet rpc code: #18499
    • The same call (relying on default values) will run different code on different machines, depending on the command line args that were used to start the server. This might lead to hard-to-debug-remote issues.

    This is a small behaviour change, and I will add release notes.

  2. rpc: Make verifychain default values static, not depend on global args fad691cafe
  3. DrahtBot added the label RPC/REST/ZMQ on Apr 6, 2020
  4. DrahtBot commented at 12:58 AM on April 7, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18531 (rpc: Assert that RPCArg names are equal to CRPCCommand ones by MarcoFalke)

    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.

  5. in src/rpc/blockchain.cpp:1095 in fad691cafe
    1091 | @@ -1094,15 +1092,12 @@ static UniValue verifychain(const JSONRPCRequest& request)
    1092 |                  },
    1093 |              }.Check(request);
    1094 |  
    1095 | -    LOCK(cs_main);
    1096 | +    const int check_level(request.params[0].isNull() ? DEFAULT_CHECKLEVEL : request.params[0].get_int());
    


    theStack commented at 2:54 PM on April 7, 2020:

    nit: should also use list initialization here ({....}), same as one line below


    MarcoFalke commented at 3:49 PM on April 7, 2020:

    That wouldn't compile


    theStack commented at 5:44 PM on April 7, 2020:

    Oh I see, DEFAULT_CHECKLEVEL has the wrong type -- unsigned even If the consuming function takes it as signed (for whatever reason).

  6. theStack commented at 2:54 PM on April 7, 2020: member

    Concept ACK

  7. theStack approved
  8. promag commented at 10:50 PM on April 9, 2020: member

    Code review ACK fad691cafe083743a26f434488990f060ae4ac45.

  9. MarcoFalke merged this on Apr 10, 2020
  10. MarcoFalke closed this on Apr 10, 2020

  11. MarcoFalke deleted the branch on Apr 10, 2020
  12. sidhujag referenced this in commit 16258a650c on Apr 13, 2020
  13. deadalnix referenced this in commit 6620ec6c59 on Jan 14, 2021
  14. 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