|
|
@ -35,7 +35,7 @@ char *LP_numutxos() |
|
|
|
char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port
|
|
|
|
{ |
|
|
|
char *method,*ipaddr,*userpass,*base,*rel,*coin,*retstr = 0; uint16_t argport=0,pushport,subport; int32_t changed,otherpeers,flag = 0; struct LP_peerinfo *peer; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; |
|
|
|
//printf("stats_JSON(%s)\n",jprint(argjson,0));
|
|
|
|
//printf("stats_JSON(%s)\n",jprint(argjson,0));
|
|
|
|
method = jstr(argjson,"method"); |
|
|
|
if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) |
|
|
|
{ |
|
|
@ -104,6 +104,7 @@ goal(coin=*, val=<autocalc>)\n\ |
|
|
|
myprice(base, rel)\n\ |
|
|
|
enable(coin)\n\ |
|
|
|
disable(coin)\n\ |
|
|
|
getrawtransaction(coin, txid)\n\ |
|
|
|
inventory(coin)\n\ |
|
|
|
bestfit(rel, relvolume)\n\ |
|
|
|
lastnonce()\n\ |
|
|
@ -329,6 +330,10 @@ stop()\n\ |
|
|
|
{ |
|
|
|
return(LP_sendrawtransaction(coin,jstr(argjson,"signedtx"))); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"getrawtransaction") == 0 ) |
|
|
|
{ |
|
|
|
return(jprint(LP_gettx(coin,jbits256(argjson,"txid")),0)); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"withdraw") == 0 ) |
|
|
|
{ |
|
|
|
if ( (ptr= LP_coinsearch(coin)) != 0 ) |
|
|
@ -448,6 +453,12 @@ stop()\n\ |
|
|
|
// end received response
|
|
|
|
|
|
|
|
// public access, even from http
|
|
|
|
else if ( strcmp(method,"tradestatus") == 0 ) |
|
|
|
{ |
|
|
|
LP_tradecommand_log(argjson); |
|
|
|
printf("GOT TRADESTATUS! %s\n",jprint(argjson,0)); |
|
|
|
retstr = clonestr("{\"result\":\"success\"}"); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"balance") == 0 ) |
|
|
|
{ |
|
|
|
if ( (ptr= LP_coinsearch(jstr(argjson,"coin"))) != 0 ) |
|
|
@ -560,7 +571,7 @@ stop()\n\ |
|
|
|
else |
|
|
|
{ |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
//printf("broadcast.(%s)\n",Broadcaststr);
|
|
|
|
//printf("broadcast.(%s)\n",Broadcaststr);
|
|
|
|
LP_reserved_msg(base!=0?base:jstr(argjson,"coin"),rel,zero,jprint(reqjson,0)); |
|
|
|
} |
|
|
|
retstr = clonestr("{\"result\":\"success\"}"); |
|
|
|