Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dooglus opened this issue Mar 13, 2017 · 4 comments
Closed

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

dooglus opened this issue Mar 13, 2017 · 4 comments

Comments

@dooglus
Copy link
Contributor

dooglus commented Mar 13, 2017

$ ./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" },
@dooglus dooglus changed the title listunspent's new include_unsafe parameter doesn't work listunspent's new include_unsafe parameter doesn't work Mar 13, 2017
@NicolasDorier
Copy link
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...

@dooglus
Copy link
Contributor Author

dooglus commented Mar 13, 2017

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" },

@jonasschnelli
Copy link
Contributor

Good catch. Thanks @dooglus

@dooglus
Copy link
Contributor Author

dooglus commented Apr 8, 2017

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

@fanquake fanquake closed this as completed Mar 7, 2018
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants