unable to add the option data to fundrawtransaction in Bitcoin Core version v0.21.1
fundrawtransaction JSON value is not a string as expected #21858
issue diadal opened this issue on May 4, 2021-
diadal commented at 7:18 PM on May 4, 2021: none
- diadal added the label Bug on May 4, 2021
-
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 -
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. -
diadal commented at 7:48 PM on May 4, 2021: none
yes php it working now
with this
$options = [ "changeAddress" => "" . $adr, "estimate_mode" => "ECONOMICAL" ]; -
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{} -
diadal commented at 7:52 PM on May 4, 2021: none
both Object
keyandvaluemust bedouble quoteforBitcoin Core version v0.21.1whilefundrawtransaction -
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?
-
diadal commented at 8:07 PM on May 4, 2021: none
the issue only occurs on this
0.21.10.21.0 below never give me this issue I user single quote''before but I have to change to double""only onfundrawtransactionother RPC still work fine with a single quote -
diadal commented at 8:09 PM on May 4, 2021: none
am using php 8
-
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.
-
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
-
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.
-
MarcoFalke commented at 5:12 AM on May 5, 2021: member
Which php library are you using?
-
diadal commented at 6:22 AM on May 5, 2021: none
laravel 8
-
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.
-
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" ]; -
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. -
MarcoFalke commented at 7:06 AM on May 5, 2021: member
Closing for now until we have more info
- MarcoFalke closed this on May 5, 2021
-
diadal commented at 7:06 AM on May 5, 2021: none
alright
- DrahtBot locked this on Aug 18, 2022