Browse Source

Test

etomic
jl777 7 years ago
parent
commit
8a2c84b45b
  1. 7
      iguana/exchanges/LP_forwarding.c

7
iguana/exchanges/LP_forwarding.c

@ -48,13 +48,14 @@ char *LP_lookup(bits256 pubkey)
else return(clonestr("{\"error\":\"notfound\"}"));
}
char *LP_register(bits256 pubkey,char *pushaddr)
char *LP_register(bits256 pubkey,char *ipaddr)
{
struct LP_forwardinfo *ptr=0; int32_t pushsock;
if ( pushaddr == 0 || pushaddr[0] == 0 || bits256_nonz(pubkey) == 0 )
struct LP_forwardinfo *ptr=0; int32_t pushsock; char pushaddr[64];
if ( ipaddr == 0 || ipaddr[0] == 0 || is_ipaddr(ipaddr) == 0 || bits256_nonz(pubkey) == 0 )
return(clonestr("{\"error\":\"illegal ipaddr or null pubkey\"}"));
//if ( strlen(pushaddr) <= strlen("tcp://") || is_ipaddr(pushaddr+strlen("tcp://")) == 0 )
// return(clonestr("{\"error\":\"illegal ipaddr\"}"));
sprintf(pushaddr,"tcp://%s",ipaddr);
char str[65]; printf("register.(%s) %s\n",pushaddr,bits256_str(str,pubkey));
if ( (ptr= LP_forwardfind(pubkey)) != 0 )
{

Loading…
Cancel
Save