From 269b95e62aa4be8f5628b0f587da74951f69709a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 12 Sep 2017 18:05:36 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_rpc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index f68a89f96..bf7528230 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -266,7 +266,7 @@ cJSON *LP_gettx(char *symbol,bits256 txid) cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) { - char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; + char buf[128],str[65],coinaddr[64],*hexstr; uint64_t value; uint8_t *serialized; cJSON *sobj,*addresses,*item,*array,*hexobj,*listjson,*retjson=0; int32_t i,n,v,len; bits256 t; struct iguana_info *coin; coin = LP_coinfind(symbol); if ( coin == 0 ) return(cJSON_Parse("{\"error\":\"no coin\"}")); @@ -278,9 +278,10 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) else { sprintf(buf,"[\"%s\"]",bits256_str(str,txid)); - if ( (retjson= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) + if ( (hexobj= bitcoin_json(coin,"blockchain.transaction.get",buf)) != 0 ) { - hexstr = jprint(retjson,1); + printf("HEX.(%s)\n",jprint(hexobj,0)); + hexstr = jprint(hexobj,1); if ( (len= is_hexstr(hexstr,0)) > 2 ) { len >>= 1; @@ -333,6 +334,7 @@ cJSON *LP_gettxout(char *symbol,bits256 txid,int32_t vout) free_json(listjson); } } + free_json(hexobj); return(retjson); } return(cJSON_Parse("{\"error\":\"couldnt get tx\"}"));