Browse Source

Test

etomic
jl777 7 years ago
parent
commit
5a7a77e10b
  1. 12
      iguana/exchanges/LP_socket.c

12
iguana/exchanges/LP_socket.c

@ -843,19 +843,19 @@ struct electrum_info *LP_electrum_info(int32_t *alreadyp,char *symbol,char *ipad
int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len) int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
{ {
cJSON *strjson,*resitem,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0; cJSON *strjson,*errjson,*resultjson,*paramsjson; char *method; int32_t i,n,height; uint32_t idnum=0; struct stritem *stritem; struct iguana_info *coin; struct queueitem *tmp,*item = 0;
if ( str == 0 || len == 0 ) if ( str == 0 || len == 0 )
return(-1); return(-1);
ep->lasttime = (uint32_t)time(NULL); ep->lasttime = (uint32_t)time(NULL);
if ( (strjson= cJSON_Parse(str)) == 0 ) /*if ( (strjson= cJSON_Parse(str)) == 0 )
{ {
strjson = cJSON_CreateObject(); strjson = cJSON_CreateObject();
resitem = cJSON_CreateObject(); resitem = cJSON_CreateObject();
jaddstr(resitem,"string",str); jaddstr(resitem,"string",str);
jadd(strjson,"result",resitem); jadd(strjson,"result",resitem);
printf("mapped.(%s) -> %s\n",str,jprint(strjson,0)); printf("mapped.(%s) -> %s\n",str,jprint(strjson,0));
} }*/
if ( 1 ) if ( (strjson= cJSON_Parse(str)) != 0 )
{ {
resultjson = jobj(strjson,"result"); resultjson = jobj(strjson,"result");
printf("strjson.(%s)\n",jprint(strjson,0)); printf("strjson.(%s)\n",jprint(strjson,0));
@ -899,7 +899,7 @@ int32_t LP_recvfunc(struct electrum_info *ep,char *str,int32_t len)
{ {
//printf("matched idnum.%d result.%p\n",idnum,resultjson); //printf("matched idnum.%d result.%p\n",idnum,resultjson);
DL_DELETE(ep->pendingQ.list,item); DL_DELETE(ep->pendingQ.list,item);
*((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : strjson); *((cJSON **)stritem->retptrp) = (resultjson != 0 ? jduplicate(resultjson) : jduplicate(strjson));
resultjson = strjson = 0; resultjson = strjson = 0;
free(item); free(item);
break; break;

Loading…
Cancel
Save