Browse Source

Test

etomic
jl777 8 years ago
parent
commit
482b512257
  1. 4
      iguana/exchanges/LP_commands.c
  2. 4
      iguana/exchanges/LP_rpc.c
  3. 2
      iguana/exchanges/lookup

4
iguana/exchanges/LP_commands.c

@ -442,9 +442,9 @@ forwardhex(pubkey,hex)\n\
//printf("RETURN. %d utxos\n",cJSON_GetArraySize(cJSON_Parse(retstr))); //printf("RETURN. %d utxos\n",cJSON_GetArraySize(cJSON_Parse(retstr)));
} }
else if ( strcmp(method,"register") == 0 ) else if ( strcmp(method,"register") == 0 )
retstr = LP_register(jbits256(argjson,"pubkey"),jstr(argjson,"pushaddr")); retstr = LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr"));
else if ( strcmp(method,"lookup") == 0 ) else if ( strcmp(method,"lookup") == 0 )
retstr = LP_lookup(jbits256(argjson,"pubkey")); retstr = LP_lookup(jbits256(argjson,"client"));
else if ( strcmp(method,"forwardhex") == 0 ) else if ( strcmp(method,"forwardhex") == 0 )
retstr = LP_forwardhex(jbits256(argjson,"pubkey"),jstr(argjson,"hex")); retstr = LP_forwardhex(jbits256(argjson,"pubkey"),jstr(argjson,"hex"));
else if ( strcmp(method,"notify") == 0 ) else if ( strcmp(method,"notify") == 0 )

4
iguana/exchanges/LP_rpc.c

@ -63,7 +63,7 @@ char *issue_LP_register(char *destip,uint16_t destport,bits256 pubkey,char *push
char url[512],str[65]; char url[512],str[65];
if ( strncmp("tcp://",pushaddr,strlen("tcp://")) != 0 || strlen(pushaddr) <= strlen("tcp://") ) if ( strncmp("tcp://",pushaddr,strlen("tcp://")) != 0 || strlen(pushaddr) <= strlen("tcp://") )
return(clonestr("{\"error\":\"illegal pushaddr\"}")); return(clonestr("{\"error\":\"illegal pushaddr\"}"));
sprintf(url,"http://%s:%u/api/stats/register?pubkey=%s&pushaddr=%s",destip,destport,bits256_str(str,pubkey),pushaddr+strlen("tcp://")); sprintf(url,"http://%s:%u/api/stats/register?client=%s&pushaddr=%s",destip,destport,bits256_str(str,pubkey),pushaddr+strlen("tcp://"));
//printf("getutxo.(%s)\n",url); //printf("getutxo.(%s)\n",url);
return(issue_curl(url)); return(issue_curl(url));
} }
@ -71,7 +71,7 @@ char *issue_LP_register(char *destip,uint16_t destport,bits256 pubkey,char *push
char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey) char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey)
{ {
char url[512],str[65]; char url[512],str[65];
sprintf(url,"http://%s:%u/api/stats/lookup?pubkey=%s",destip,destport,bits256_str(str,pubkey)); sprintf(url,"http://%s:%u/api/stats/lookup?client=%s",destip,destport,bits256_str(str,pubkey));
//printf("getutxo.(%s)\n",url); //printf("getutxo.(%s)\n",url);
return(issue_curl(url)); return(issue_curl(url));
} }

2
iguana/exchanges/lookup

@ -0,0 +1,2 @@
source userpass
curl --url "http://127.0.0.1:7779" --data "{\"userpass\":\"$userpass\",\"pubkey\":\"6578099f6474d9b8bd66a7a136b922029a989818ec0309aee962dd6ac1862b74\",\"method\":\"forward\",\"method2\":\"lookup\",\"client\":\"$1\"}"
Loading…
Cancel
Save