diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index 73a7e188e..25518a736 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -945,8 +945,9 @@ ARRAY_OBJ_INT(bitcoinrpc,createrawtransaction,vins,vouts,locktime) iguana_createvins(myinfo,coin,txobj,vins); if ( (n= cJSON_GetArraySize(vouts)) > 0 ) { - if ( (item= vouts->child) != 0 && n == 1 ) - item = item->child; + if ( vouts->child != 0 && n == 1 ) + item = vouts->child; + else item = vouts; while ( item != 0 ) { if ( (field= jfieldname(item)) != 0 ) diff --git a/iguana/tests/createrawtransactionT b/iguana/tests/createrawtransactionT new file mode 100755 index 000000000..1e48c0e7f --- /dev/null +++ b/iguana/tests/createrawtransactionT @@ -0,0 +1 @@ +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createrawtransaction\",\"params\":[[{\"txid\":\"2196c07f71f206728301b03ffbffb7fd383744d03c1a3e0a1e03b6fb9ffd4ece\",\"vout\":1}], {\"1E4EadLDvqRWgSPRLqTM5YXefdaxsPPZVs\":0.009}] }" diff --git a/iguana/tests/decoderawtransaction b/iguana/tests/decoderawtransaction index fbccbbd4c..dc4437c80 100755 --- a/iguana/tests/decoderawtransaction +++ b/iguana/tests/decoderawtransaction @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"method\":\"decoderawtransaction\",\"params\":[\"0100000093b7325701f6d17d847b7096cdd9b79e4df4b74aabb9ac34b7abd4f9fce19d761e97cca0e80000000000ffffffff0240420f00000000001976a91410acba3a841fae68aba4b5ff162714c493bcc04e88acd0300e00000000001976a914d8b8c039206af6cec82bca950f592801e62808cb88ac00000000\"]}" +curl --url "http://127.0.0.1:7778" --data "{\"method\":\"decoderawtransaction\",\"params\":[\"0100000051e2335701ce4efd9ffbb6031e0a3e1a3cd0443738fdb7fffb3fb001837206f2717fc096210100000000ffffffff0000000000\"]}"