RPC/blockchain: Elaborate on scantxoutset documentation #25339

pull luke-jr wants to merge 3 commits into bitcoin:master from luke-jr:rpcdoc_scantxoutset_20220611a changing 1 files +7 −7
  1. luke-jr commented at 4:37 PM on June 11, 2022: member

    Minor doc improvements

  2. luke-jr force-pushed on Jun 11, 2022
  3. luke-jr force-pushed on Jun 11, 2022
  4. luke-jr force-pushed on Jun 11, 2022
  5. DrahtBot added the label RPC/REST/ZMQ on Jun 11, 2022
  6. in src/rpc/blockchain.cpp:2330 in c62b7c1ee0 outdated
    2323 | @@ -2330,6 +2324,12 @@ static RPCHelpMan scantxoutset()
    2324 |                  }},
    2325 |                  {RPCResult::Type::STR_AMOUNT, "total_amount", "The total amount of all found unspent outputs in " + CURRENCY_UNIT},
    2326 |              }},
    2327 | +            RPCResult{"when action=='abort'", RPCResult::Type::BOOL, "success", "True if scan will be aborted (not necessarily before this RPC call returns), or false if there is no scan to abort."},
    2328 | +            RPCResult{"when action=='status' and a scan is currently in progress", RPCResult::Type::OBJ, "", "",
    2329 | +            {
    2330 | +                {RPCResult::Type::NUM, "progress", "Approximate percent complete."},
    


    jonatack commented at 9:33 AM on June 13, 2022:

    (the other fields in this RPC don't end with a period)

                    {RPCResult::Type::NUM, "progress", "Approximate percent complete"},
    
  7. in src/rpc/blockchain.cpp:2327 in c62b7c1ee0 outdated
    2323 | @@ -2330,6 +2324,12 @@ static RPCHelpMan scantxoutset()
    2324 |                  }},
    2325 |                  {RPCResult::Type::STR_AMOUNT, "total_amount", "The total amount of all found unspent outputs in " + CURRENCY_UNIT},
    2326 |              }},
    2327 | +            RPCResult{"when action=='abort'", RPCResult::Type::BOOL, "success", "True if scan will be aborted (not necessarily before this RPC call returns), or false if there is no scan to abort."},
    


    jonatack commented at 9:34 AM on June 13, 2022:

    nit, call is redundant with the meaning of RPC

                RPCResult{"when action=='abort'", RPCResult::Type::BOOL, "success", "True if scan will be aborted (not necessarily before this RPC returns), or false if there is no scan to abort."},
    
  8. jonatack commented at 9:45 AM on June 13, 2022: member

    ACK modulo suggestions. I think the first two commits can be squashed, could also touch up the following line (see the line just above it throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan already in progress, use action \"abort\" or \"status\"");)

    --- a/src/rpc/blockchain.cpp
    +++ b/src/rpc/blockchain.cpp
    @@ -2103,7 +2103,7 @@ static RPCHelpMan scantxoutset()
             }
     
             if (request.params.size() < 2) {
    -            throw JSONRPCError(RPC_MISC_ERROR, "scanobjects argument is required for the start action");
    +            throw JSONRPCError(RPC_MISC_ERROR, "The \"scanobjects\" argument is required for the \"start\" action");
             }
    
  9. luke-jr commented at 2:01 PM on June 13, 2022: member
    -            throw JSONRPCError(RPC_MISC_ERROR, "scanobjects argument is required for the start action");
    +            throw JSONRPCError(RPC_MISC_ERROR, "The \"scanobjects\" argument is required for the \"start\" action");
    

    I think the current error is better...

  10. RPC/blockchain: Elaborate on scantxoutset documentation b283e4d823
  11. scripted-diff: RPC/blockchain: Lowercase "when" in scantxoutset documentation
    -BEGIN VERIFY SCRIPT-
    sed -i -e 's/"When /"when /' $(git grep -l 'RPCResult{"When ')
    -END VERIFY SCRIPT-
    98718d03be
  12. RPC/blockchain: Reorder result documentation for scantxoutset
    start, abort, status (with result), and status (no result) makes more logical sense
    7862c4ac4e
  13. luke-jr force-pushed on Jun 13, 2022
  14. achow101 commented at 7:44 PM on June 14, 2022: member

    ACK 7862c4ac4e7afc954ef9e2c7ee8c556e1654a374

  15. MarcoFalke merged this on Jun 15, 2022
  16. MarcoFalke closed this on Jun 15, 2022

  17. sidhujag referenced this in commit 56d3595a2b on Jun 15, 2022
  18. DrahtBot locked this on Jun 15, 2023

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

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