From 9d2ad0c524985bdabcb8611cfc5ff9fe1b03f47c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Nov 2016 18:45:02 -0300 Subject: [PATCH] test --- iguana/iguana_payments.c | 2 +- iguana/iguana_wallet.c | 5 +++-- iguana/tests/listtransactions | 2 +- iguana/tests/listunspent | 2 +- iguana/tests/listunspent2 | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index 7cdf118c6..f5d7a7300 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -1238,7 +1238,7 @@ cJSON *iguana_listunspents(struct supernet_info *myinfo,struct iguana_info *coin { array = iguana_getaddressesbyaccount(myinfo,coin,"*"); flag = 1; - //printf("listunspent.(%s)\n",jprint(array,0)); + printf("listunspent.(%s)\n",jprint(array,0)); } if ( minconf == 0 ) minconf = 1; diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index 834aab885..c7b4815db 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1731,7 +1731,7 @@ STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatch return(clonestr("{\"error\":\"need to unlock wallet\"}")); retjson = cJSON_CreateObject(); retarray = cJSON_CreateArray(); - if ( (wacct= iguana_waccountfind(myinfo,account)) != 0 ) + if ( account == 0 || account[0] == 0 || (wacct= iguana_waccountfind(myinfo,account)) != 0 ) { if ( (array= iguana_getaddressesbyaccount(myinfo,coin,account)) != 0 ) { @@ -1768,7 +1768,8 @@ STRING_AND_THREEINTS(bitcoinrpc,listtransactions,account,count,skip,includewatch "blocktime": 1448045745, }*/ item = cJSON_CreateObject(); - jaddstr(item,"account",wacct->account); + if ( wacct != 0 ) + jaddstr(item,"account",wacct->account); iguana_txdetails(myinfo,coin,item,txid,vout,iguana_txidheight(myinfo,coin,txid)); jaddi(retarray,item); } diff --git a/iguana/tests/listtransactions b/iguana/tests/listtransactions index 430fee991..add0ca2e9 100755 --- a/iguana/tests/listtransactions +++ b/iguana/tests/listtransactions @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listtransactions\",\"params\":[1, 9999999, [\"RUXwXF37SMA63vL4bUPnytP3KUwp69PCVv\"]]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listtransactions\",\"params\":[1, 9999999, [\"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\"]]}" diff --git a/iguana/tests/listunspent b/iguana/tests/listunspent index 3f0142af8..5e66227ec 100755 --- a/iguana/tests/listunspent +++ b/iguana/tests/listunspent @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" diff --git a/iguana/tests/listunspent2 b/iguana/tests/listunspent2 index 5e66227ec..b9c04d79b 100755 --- a/iguana/tests/listunspent2 +++ b/iguana/tests/listunspent2 @@ -1,2 +1,2 @@ #!/bin/bash -curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" +curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, [\"RNJmgYaFF5DbnrNUX6pMYz9rcnDKC2tuAc\"]]}"