I'm attempting to add an RPC command to bitcoind. (createchaintradetx in this case)
(Code thus far:
https://github.com/XertroV/bitcoin/commit/645c88d361a18c330845e5697ea9c817045bd452)
I'd like to convert one fo the input values, and it seems there's a lot of that done in bitcoinrpc.cpp in function RPCConvertValues.
I've added the line I presume I need:
if (strMethod == "createchaintradetx" && n > 5) ConvertTo(params[5]);
However, I continue to recieve
error: {"code":-1,"message":"value is type str, expected real"}
I presume the conversion is failing. I've confirmed this with a previous RPC command I tried to add and had the same problem.
Does anyone know why this is failing? I've grepped through for other function names (such as createrawtransaction) and can't find other references to them that would hint at what is needed to fix this.
Edit: as a testcase to produce the above error, if you clone the chaintrade branch linked above, you should be able to compile and run the following on testnet:
b-test createchaintradetx 7415e100520c4fc2de9429958c0b64500a076b48ef2ad0648c7243c52046c671 2102c1acc4dd7c5b43eee5626dbf0349095bfc85f16ce8dcf48025a0c0ef93c2644a 7415e100520c4fc2de9429958c0b64500a076b48ef2ad0648c7243c52046c671 2102c1acc4dd7c5b43eee5626dbf0349095bfc85f16ce8dcf48025a0c0ef93c2644a 5b50d05942cc2b5f65bbe4077e35e968cb743faad20910e02a26becf87e05f2a 1