Browse Source

Test

etomic
jl777 8 years ago
parent
commit
6b2c6863e1
  1. 6
      iguana/exchanges/LP_commands.c
  2. 7
      iguana/exchanges/LP_rpc.c

6
iguana/exchanges/LP_commands.c

@ -216,7 +216,11 @@ forwardhex(pubkey,hex)\n\
else if ( IAMLP != 0 )
{
if ( strcmp(method,"register") == 0 )
return(LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr")));
{
retstr = LP_register(jbits256(argjson,"client"),jstr(argjson,"pushaddr"));
printf("got (%s) from register\n",retstr!=0?retstr:"");
return(retstr);
}
else if ( strcmp(method,"lookup") == 0 )
return(LP_lookup(jbits256(argjson,"client")));
else if ( strcmp(method,"forwardhex") == 0 )

7
iguana/exchanges/LP_rpc.c

@ -106,12 +106,13 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx
char *issue_LP_register(char *destip,uint16_t destport,bits256 pubkey,char *pushaddr)
{
char url[512],str[65];
char url[512],str[65],*retstr;
if ( strncmp("tcp://",pushaddr,strlen("tcp://")) != 0 || strlen(pushaddr) <= strlen("tcp://") )
return(clonestr("{\"error\":\"illegal pushaddr\"}"));
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);
return(issue_curlt(url,LP_HTTP_TIMEOUT));
retstr = issue_curlt(url,LP_HTTP_TIMEOUT);
printf("getutxo.(%s) -> (%s)\n",url,retstr!=0?retstr:"");
return(retstr);
}
char *issue_LP_lookup(char *destip,uint16_t destport,bits256 pubkey)

Loading…
Cancel
Save