fundrawtransaction JSON value is not a string as expected #21858

issue diadal opened this issue on May 4, 2021
  1. diadal commented at 7:18 PM on May 4, 2021: none

    unable to add the option data to fundrawtransaction in Bitcoin Core version v0.21.1

  2. diadal added the label Bug on May 4, 2021
  3. jonatack commented at 7:25 PM on May 4, 2021: member

    Hi @diadal, can you provide the OS platform and rpc calls or cli commands made to reproduce your issue?

  4. diadal commented at 7:27 PM on May 4, 2021: none

    key and value must be double quote

    $options = [
                "changeAddress" => "" . $adr,
                "estimate_mode" => "ECONOMICAL"
            ];
    

    this work before I want using single quote without any issue

    Mac Catalina and Big Sur rpc calls

  5. jonatack commented at 7:47 PM on May 4, 2021: member

    The options are a JSON object. I don't know what language you are using (PHP?) but as a guess, for a JSON object it might need to be in curly braces, e.g. options = {'changeAddress' => "" . $adr, 'estimate_mode' => 'ECONOMICAL'} and so on.

  6. diadal commented at 7:48 PM on May 4, 2021: none

    yes php it working now

    with this $options = [ "changeAddress" => "" . $adr, "estimate_mode" => "ECONOMICAL" ];

  7. diadal commented at 7:50 PM on May 4, 2021: none

    this {'changeAddress' => "" . $adr, 'estimate_mode' => 'ECONOMICAL'} will give error php 7.4 above no longer support {}

  8. diadal commented at 7:52 PM on May 4, 2021: none

    both Object key and value must be double quote for Bitcoin Core version v0.21.1 while fundrawtransaction

  9. jonatack commented at 7:58 PM on May 4, 2021: member

    Are you saying that the quote-handling behavior of the Bitcoin Core fundraw RPC changed in 0.21.1 since a previous version, with the same environment and code on your side? If yes, what was the previous version of Bitcoin Core?

  10. diadal commented at 8:07 PM on May 4, 2021: none

    the issue only occurs on this 0.21.1 0.21.0 below never give me this issue I user single quote '' before but I have to change to double "" only on fundrawtransaction other RPC still work fine with a single quote

  11. diadal commented at 8:09 PM on May 4, 2021: none

    am using php 8

  12. sipa commented at 8:27 PM on May 4, 2021: member

    That is very surprising. Those single or double quotes aren't even sent to Bitcoin Core.

  13. diadal commented at 8:45 PM on May 4, 2021: none

    well have tried again mac book Catalina and Mac mini Big Sur same issue working only with double quotes due both pc are PHP 8 maybe but 0.21.0 works

  14. jonatack commented at 8:57 PM on May 4, 2021: member

    Could be a good idea to re-verify that something else didn't change or get updated in your development environment, e.g. language version or other libraries or dependencies.

  15. MarcoFalke commented at 5:12 AM on May 5, 2021: member

    Which php library are you using?

  16. diadal commented at 6:22 AM on May 5, 2021: none

    laravel 8

  17. MarcoFalke commented at 6:53 AM on May 5, 2021: member

    Is this https://github.com/denpamusic/laravel-bitcoinrpc ? If yes, they might be able to help you, since none of us know anything about PHP and this looks like an issue unrelated to Bitcoin Core at first.

  18. diadal commented at 6:56 AM on May 5, 2021: none

    Is this https://github.com/denpamusic/laravel-bitcoinrpc ? If yes, they might be able to help you, since none of us know anything about PHP and this looks like an issue unrelated to Bitcoin Core at first.

    no don't stress yourself already fix this I said it before that using double quotes fixed this issue

    yes php it working now

    with this $options = [ "changeAddress" => "" . $adr, "estimate_mode" => "ECONOMICAL" ];

  19. MarcoFalke commented at 7:05 AM on May 5, 2021: member

    Again, none of us know any PHP and without a dump of the serialized data that triggers the bug, there is nothing we can do. Alternatively, if you can reproduce the bug with bitcoin-cli, it would help us.

  20. MarcoFalke commented at 7:06 AM on May 5, 2021: member

    Closing for now until we have more info

  21. MarcoFalke closed this on May 5, 2021

  22. diadal commented at 7:06 AM on May 5, 2021: none

    alright

  23. DrahtBot locked this on Aug 18, 2022
Labels

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-21 18:14 UTC

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