Some JSON values don't work in the GUI console #1750

issue gmaxwell opened this issue on August 29, 2012
  1. gmaxwell commented at 4:24 AM on August 29, 2012: contributor

    I can't find a mixture (or absence) of quoting that makes this work in the GUI console:

    addmultisigaddress 2 '["02404c0b780b0d3f70a57bccb0cac31c77e980d899db00f04a61052cf6500bde23","02092eb733ce9027fcddb9917e841057c747318ff973de7a7768da9b3f039d6892"]'

  2. Diapolo commented at 7:23 AM on August 29, 2012: none

    What is the exact string, that is working with bitcoind? The help message for addmultisigaddress shows that " need to be escaped as \" (which doesn't currently work with the console either).

  3. gmaxwell commented at 7:36 AM on August 29, 2012: contributor

    What I gave above is an exact working commandline w/ bitcoind + bash. Under windows you may need to change the outer single quotes to " or something like that.

  4. Diapolo commented at 7:41 AM on August 29, 2012: none

    Got it, seems like an escaping issue ^^.

    I used this command on Windows: addmultisigaddress 2 \"[\\\"02404c0b780b0d3f70a57bccb0cac31c77e980d899db00f04a61052cf6500bde23\\\",\\\"02092eb733ce9027fcddb9917e841057c747318ff973de7a7768da9b3f039d6892\\\"]\"

    I'm wondering, why the ' is not working though?

    Edit: Inputting the above into RPC console leads to this string passed to bitcoinrpc.cpp: "[\"02404c0b780b0d3f70a57bccb0cac31c77e980d899db00f04a61052cf6500bde23\",\"02092eb733ce9027fcddb9917e841057c747318ff973de7a7768da9b3f039d6892\"]"

  5. Diapolo commented at 8:24 AM on August 29, 2012: none

    @laanwj Any good idea for the JSON arrays and the RPC console?

  6. laanwj commented at 9:30 AM on August 29, 2012: member

    Thanks for testing and examples @diapolo. This is something with boost:escaped string not emulating bash well enough. I'll try to fix this before rc2.

  7. Diapolo commented at 9:39 AM on August 29, 2012: none

    @laanwj Yeah that would be nice! It seems a little weird to see the help output, which contains ' and as Windows user I have to replace that by \" is there any chance to internally fix this or at least let the RPC help string contain the correct format for each OS?

  8. laanwj commented at 9:44 AM on August 29, 2012: member

    The rpc console should ideally be the same for every OS as all the parsing is using platform independent code.

    If there is also a difference between platforms this is even more messed up than I thought.

  9. Diapolo commented at 9:47 AM on August 29, 2012: none

    The thing I mentioned above is perhaps not even related to our GUI RPC console, but to the JSON code we use?

  10. ghost assigned laanwj on Aug 29, 2012
  11. laanwj referenced this in commit 777832a28f on Aug 30, 2012
  12. laanwj referenced this in commit 86d3b76367 on Aug 31, 2012
  13. laanwj referenced this in commit 576b5efe93 on Aug 31, 2012
  14. laanwj referenced this in commit 10a0f20fc3 on Sep 1, 2012
  15. gavinandresen closed this on Sep 5, 2012

  16. 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 18:16 UTC

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