listunspent's new include_unsafe parameter doesn't work #9982

issue dooglus opened this issue on March 13, 2017
  1. dooglus commented at 5:32 AM on March 13, 2017: contributor
    $ ./bitcoin-cli listunspent 0 9999999 '[]' true
    error code: -3
    error message:
    Expected type bool, got string

    rpc/client.cpp probably needs to list the parameter along with the other 3:

        { "listunspent", 0, "minconf" },
        { "listunspent", 1, "maxconf" },
        { "listunspent", 2, "addresses" },

    Add this?

        { "listunspent", 3, "include_unsafe" },
  2. dooglus renamed this:
    `listunspent`'s new `include_unsafe` parameter doesn't work
    listunspent's new include_unsafe parameter doesn't work
    on Mar 13, 2017
  3. NicolasDorier commented at 6:02 AM on March 13, 2017: contributor

    I confirm. This is strange I would have swear I already used it successfully. I do not see what is wrong with the code either...

  4. dooglus commented at 6:05 AM on March 13, 2017: contributor

    rpc/client.cpp needs to list the parameter as needing interpretation for any non-string parameter.

    Can confirm that this change fixes the problem:

    diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
    index 5bdd84e..16eb723 100644
    --- a/src/rpc/client.cpp
    +++ b/src/rpc/client.cpp
    @@ -79,6 +79,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
         { "listunspent", 0, "minconf" },
         { "listunspent", 1, "maxconf" },
         { "listunspent", 2, "addresses" },
    +    { "listunspent", 3, "include_unsafe" },
         { "getblock", 1, "verbose" },
         { "getblockheader", 1, "verbose" },
         { "gettransaction", 1, "include_watchonly" },
  5. laanwj added the label RPC/REST/ZMQ on Mar 13, 2017
  6. jonasschnelli commented at 7:22 AM on March 13, 2017: contributor

    Good catch. Thanks @dooglus

  7. dooglus commented at 8:52 PM on April 8, 2017: contributor

    Do I need to make a pull request for this? It seems to have been missed in 0.14.1 rc1.

  8. fanquake closed this on Mar 7, 2018

  9. DrahtBot locked this on Sep 8, 2021

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