Browse Source

Test

etomic
jl777 8 years ago
parent
commit
b21d7e5ffc
  1. 5
      iguana/exchanges/LP_forwarding.c
  2. 2
      iguana/exchanges/LP_rpc.c

5
iguana/exchanges/LP_forwarding.c

@ -53,8 +53,9 @@ char *LP_register(bits256 pubkey,char *pushaddr)
struct LP_forwardinfo *ptr=0; int32_t pushsock; struct LP_forwardinfo *ptr=0; int32_t pushsock;
if ( pushaddr == 0 || pushaddr[0] == 0 || bits256_nonz(pubkey) == 0 ) if ( pushaddr == 0 || pushaddr[0] == 0 || bits256_nonz(pubkey) == 0 )
return(clonestr("{\"error\":\"illegal ipaddr or null pubkey\"}")); return(clonestr("{\"error\":\"illegal ipaddr or null pubkey\"}"));
if ( strlen(pushaddr) <= strlen("tcp://") || is_ipaddr(pushaddr+strlen("tcp://")) == 0 ) //if ( strlen(pushaddr) <= strlen("tcp://") || is_ipaddr(pushaddr+strlen("tcp://")) == 0 )
return(clonestr("{\"error\":\"illegal ipaddr\"}")); // return(clonestr("{\"error\":\"illegal ipaddr\"}"));
char str[65]; printf("register.(%s) %s\n",pushaddr,bits256_str(str,pubkey));
if ( (ptr= LP_forwardfind(pubkey)) != 0 ) if ( (ptr= LP_forwardfind(pubkey)) != 0 )
{ {
ptr->lasttime = (uint32_t)time(NULL); ptr->lasttime = (uint32_t)time(NULL);

2
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); sprintf(url,"http://%s:%u/api/stats/register?pubkey=%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));
} }

Loading…
Cancel
Save