Browse Source

Test

etomic
jl777 8 years ago
parent
commit
af64ea9ea1
  1. 2
      iguana/exchanges/LP_forwarding.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 2
      iguana/exchanges/LP_rpc.c

2
iguana/exchanges/LP_forwarding.c

@ -49,7 +49,7 @@ char *LP_lookup(bits256 pubkey)
char *LP_register(bits256 pubkey,char *pushaddr)
{
struct LP_forwardinfo *ptr=0; int32_t pushsock;
if ( is_ipaddr(pushaddr+strlen("tcp://")) == 0 )
if ( strlen(pushaddr) <= strlen("tcp://") || is_ipaddr(pushaddr+strlen("tcp://")) == 0 )
return(clonestr("{\"error\":\"illegal ipaddr\"}"));
if ( (ptr= LP_forwardfind(pubkey)) != 0 )
{

2
iguana/exchanges/LP_nativeDEX.c

@ -225,7 +225,7 @@ void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,in
LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",100,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,profitmargin);
}
}
printf("mainloop\n");
printf("mainloop pushaddr.(%s)\n",pushaddr);
if ( IAMLP == 0 )
{
while ( 1 )

2
iguana/exchanges/LP_rpc.c

@ -61,6 +61,8 @@ 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];
if ( strncmp("tcp://",pushaddr,strlen("tcp://")) != 0 || strlen(pushaddr) <= strlen("tcp://") )
return(clonestr("{\"error\":\"illegal pushaddr\"}"));
sprintf(url,"http://%s:%u/api/stats/register?pubkey=%s&pushaddr=%s",destip,destport,bits256_str(str,pubkey),pushaddr);
//printf("getutxo.(%s)\n",url);
return(issue_curl(url));

Loading…
Cancel
Save