jl777 7 years ago
parent
commit
c25001512e
  1. 2
      iguana/exchanges/LP_commands.c
  2. 3
      iguana/exchanges/LP_network.c
  3. 5
      iguana/exchanges/stats.c

2
iguana/exchanges/LP_commands.c

@ -38,7 +38,7 @@ char *stats_JSON(void *ctx,int32_t fastflag,char *myipaddr,int32_t pubsock,cJSON
method = jstr(argjson,"method"); method = jstr(argjson,"method");
if ( method != 0 && (strcmp(method,"addr_unspents") == 0 || strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0) ) if ( method != 0 && (strcmp(method,"addr_unspents") == 0 || strcmp(method,"uitem") == 0 || strcmp(method,"postutxos") == 0) )
return(0); return(0);
//printf("stats_JSON.(%s)\n",jprint(argjson,0)); printf("stats_JSON.(%s)\n",jprint(argjson,0));
/*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) )
{ {
if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 )

3
iguana/exchanges/LP_network.c

@ -445,7 +445,7 @@ void LP_commandQ_loop(void *ctx)
portable_mutex_unlock(&LP_commandQmutex); portable_mutex_unlock(&LP_commandQmutex);
if ( ptr->stats_JSONonly < 0 ) // broadcast passthrough if ( ptr->stats_JSONonly < 0 ) // broadcast passthrough
{ {
if ( 1 && ptr->responsesock >= 0 ) if ( ptr->responsesock >= 0 )
{ {
if ( (result= cJSON_Parse(ptr->msg)) != 0 ) if ( (result= cJSON_Parse(ptr->msg)) != 0 )
{ {
@ -461,6 +461,7 @@ void LP_commandQ_loop(void *ctx)
} }
else if ( (argjson= cJSON_Parse(ptr->msg)) != 0 ) else if ( (argjson= cJSON_Parse(ptr->msg)) != 0 )
{ {
printf("deQ.(%s)\n",jprint(argjson,0));
if ( (retstr= LP_command_process(ctx,"127.0.0.1",ptr->responsesock,argjson,(uint8_t *)ptr->msg,ptr->msglen,ptr->stats_JSONonly)) != 0 ) if ( (retstr= LP_command_process(ctx,"127.0.0.1",ptr->responsesock,argjson,(uint8_t *)ptr->msg,ptr->msglen,ptr->stats_JSONonly)) != 0 )
{ {
if ( ptr->retstrp != 0 ) if ( ptr->retstrp != 0 )

5
iguana/exchanges/stats.c

@ -564,7 +564,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po
if ( is_cJSON_Array(arg) != 0 && cJSON_GetArraySize(arg) == 1 ) if ( is_cJSON_Array(arg) != 0 && cJSON_GetArraySize(arg) == 1 )
arg = jitem(arg,0); arg = jitem(arg,0);
} else arg = argjson; } else arg = argjson;
//printf("ARGJSON.(%s)\n",jprint(arg,0)); printf("ARGJSON.(%s)\n",jprint(arg,0));
if ( userpass != 0 && jstr(arg,"userpass") == 0 ) if ( userpass != 0 && jstr(arg,"userpass") == 0 )
jaddstr(arg,"userpass",userpass); jaddstr(arg,"userpass",userpass);
#ifdef FROM_MARKETMAKER #ifdef FROM_MARKETMAKER
@ -573,6 +573,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po
if ( IPC_ENDPOINT >= 0 && (queueid= juint(arg,"queueid")) > 0 ) if ( IPC_ENDPOINT >= 0 && (queueid= juint(arg,"queueid")) > 0 )
{ {
buf = jprint(arg,0); buf = jprint(arg,0);
printf("Q command\n");
LP_queuecommand(&retstr,buf,IPC_ENDPOINT,1,queueid); LP_queuecommand(&retstr,buf,IPC_ENDPOINT,1,queueid);
free(buf); free(buf);
retstr = clonestr("{\"result\":\"success\",\"status\":\"queued\"}"); retstr = clonestr("{\"result\":\"success\",\"status\":\"queued\"}");
@ -854,7 +855,7 @@ void stats_rpcloop(void *args)
continue; continue;
} }
req = calloc(1,sizeof(*req)); req = calloc(1,sizeof(*req));
//printf("alloc req.%p\n",req); printf("LP_rpc_processreq req.%p\n",req);
req->sock = sock; req->sock = sock;
req->ipbits = ipbits; req->ipbits = ipbits;
req->port = port; req->port = port;

Loading…
Cancel
Save