rpc: The RPC result contains '\n' #21916

issue hebasto opened this issue on May 11, 2021
  1. hebasto commented at 12:35 PM on May 11, 2021: member

    On master (e175a20769b5a7b98ee3082d89f9d4f31a4503d6):

    $ src/bitcoin-cli createwallet "hww" true true "" true true true
    {
      "name": "hww",
      "warning": "Empty string given as passphrase, wallet will not be encrypted.\nWallet is an experimental descriptor wallet"
    }
    

    Is it expected?

  2. ryanofsky commented at 3:00 PM on May 11, 2021: member

    It's maybe not ideal, but I don't think it's a problem. I think it was first introduced #17070

    https://github.com/bitcoin/bitcoin/pull/17070/files#diff-63c7710d72381cffe692175dd70e47f1891bf75c3e09249ed826f9df3917d02dR2598

    Ideally "warning" would be "warnings" and a list of strings instead of a list of newline separated strings. But "warning" was introduced first, so it keeps compatibility

  3. laanwj commented at 6:00 PM on May 20, 2021: member

    There's no problem with JSON strings containing newlines. I'd agree a list of errors would have been more elegant, but I am not sure it is worth switching this around again now. Client software can split the string if they want.

  4. laanwj added the label RPC/REST/ZMQ on May 20, 2021
  5. hebasto closed this on May 20, 2021

  6. MarcoFalke commented at 6:55 AM on May 21, 2021: member

    I think it was first introduced #17070

    This existed before for createwallet. 17070 changed the separator from "; " to "\n".

  7. DrahtBot locked this on Aug 18, 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