From 9bc4cede70c9d48d6677ab9a021af571cf8ec7ce Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 20 Apr 2016 22:07:19 -0500 Subject: [PATCH] test --- iguana/SuperNET.c | 2 +- iguana/ramchain_api.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index d64b09664..bc2fbad94 100755 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -649,7 +649,7 @@ int32_t SuperNET_destination(struct supernet_info *myinfo,uint32_t *destipbitsp, char *SuperNET_JSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr,uint16_t port) { char hexbuf[8192]; bits256 category,subhash; - int32_t hexlen,destflag,maxdelay,flag=0,newflag=0; uint32_t destipbits,timestamp; cJSON *retjson; + int32_t hexlen,destflag,maxdelay,flag=0,newflag=0; uint32_t destipbits,timestamp; //cJSON *retjson; char *forwardstr=0,*retstr=0,*agent=0,*method=0,*message,*hexmsg=0,*jsonstr=0; uint64_t tag; //printf("SuperNET_JSON.(%s)\n",jprint(json,0)); if ( remoteaddr != 0 && strcmp(remoteaddr,"127.0.0.1") == 0 ) diff --git a/iguana/ramchain_api.c b/iguana/ramchain_api.c index e806b4ec3..5436b9a09 100755 --- a/iguana/ramchain_api.c +++ b/iguana/ramchain_api.c @@ -187,14 +187,16 @@ HASH_AND_INT(bitcoinrpc,getrawtransaction,txid,verbose) STRING_ARG(bitcoinrpc,decoderawtransaction,rawtx) { - cJSON *txobj; bits256 txid; + cJSON *txobj = 0; bits256 txid; if ( rawtx != 0 && rawtx[0] != 0 ) { if ( (strlen(rawtx) & 1) != 0 ) return(clonestr("{\"error\":\"rawtx hex has odd length\"}")); txobj = bitcoin_hex2json(coin,&txid,0,rawtx); char str[65]; printf("got txid.(%s)\n",bits256_str(str,txid)); - } else txobj = cJSON_CreateObject(); + } + if ( txobj == 0 ) + txobj = cJSON_CreateObject(); return(jprint(txobj,1)); }