Browse Source

Test

etomic
jl777 8 years ago
parent
commit
798c2b20da
  1. 7
      iguana/exchanges/LP_forwarding.c
  2. 2
      iguana/exchanges/LP_nativeDEX.c

7
iguana/exchanges/LP_forwarding.c

@ -146,16 +146,17 @@ char *LP_register(bits256 pubkey,char *ipaddr,uint16_t port)
void LP_forwarding_register(bits256 pubkey,char *pushaddr,uint16_t pushport,int32_t max)
{
char *retstr; cJSON *retjson; struct LP_peerinfo *peer,*tmp; int32_t n=0,retval = -1;
char *retstr,ipaddr[64];; cJSON *retjson; struct LP_peerinfo *peer,*tmp; int32_t n=0,retval = -1;
if ( pushaddr == 0 || pushaddr[0] == 0 || bits256_nonz(pubkey) == 0 )
{
printf("LP_forwarding_register illegal pushaddr or null pubkey\n");
return;
}
parse_ipaddr(ipaddr,pushaddr);
HASH_ITER(hh,LP_peerinfos,peer,tmp)
{
printf("register %s %u with (%s)\n",pushaddr,pushport,peer->ipaddr);
if ( (retstr= issue_LP_register(peer->ipaddr,peer->port,pubkey,pushaddr,pushport)) != 0 )
printf("register %s %u with (%s)\n",ipaddr,pushport,peer->ipaddr);
if ( (retstr= issue_LP_register(peer->ipaddr,peer->port,pubkey,ipaddr,pushport)) != 0 )
{
//printf("[%s] LP_register.(%s) returned.(%s)\n",pushaddr,peer->ipaddr,retstr);
if ( (retjson= cJSON_Parse(retstr)) != 0 )

2
iguana/exchanges/LP_nativeDEX.c

@ -278,7 +278,7 @@ int32_t LP_mainloop_iter(char *myipaddr,struct LP_peerinfo *mypeer,int32_t pubso
LP_myutxo_updates(pubsock,passphrase,profitmargin);
if ( lastforward < now-3600 )
{
LP_forwarding_register(LP_mypubkey,origipaddr,pushport,10);
LP_forwarding_register(LP_mypubkey,pushaddr,pushport,10);
lastforward = now;
}
}

Loading…
Cancel
Save