Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
047b292e84
  1. 4
      iguana/iguana777.c
  2. 6
      iguana/iguana_peers.c

4
iguana/iguana777.c

@ -583,7 +583,9 @@ void iguana_coinloop(void *arg)
for (j=0; j<sizeof(ipaddrs)/sizeof(*ipaddrs); j++) for (j=0; j<sizeof(ipaddrs)/sizeof(*ipaddrs); j++)
{ {
printf("%s ",ipaddrs[j]); printf("%s ",ipaddrs[j]);
iguana_possible_peer(coin,ipaddrs[j]); if ( j < IGUANA_MINPEERS )
iguana_launchpeer(coin,ipaddrs[j]);
else iguana_possible_peer(coin,ipaddrs[j]);
} }
printf("possible peers\n"); printf("possible peers\n");
} }

6
iguana/iguana_peers.c

@ -780,12 +780,12 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr)
return((uint32_t)time(NULL)); return((uint32_t)time(NULL));
} }
#endif #endif
//printf("check possible peer.(%s)\n",ipaddr); printf("check possible peer.(%s)\n",ipaddr);
for (i=n=0; i<coin->MAXPEERS; i++) for (i=n=0; i<coin->MAXPEERS; i++)
{ {
if ( strcmp(ipaddr,coin->peers.active[i].ipaddr) == 0 ) if ( strcmp(ipaddr,coin->peers.active[i].ipaddr) == 0 )
{ {
//printf("(%s) already active\n",ipaddr); printf("(%s) already active\n",ipaddr);
free_queueitem(ipaddr); free_queueitem(ipaddr);
return((uint32_t)time(NULL)); return((uint32_t)time(NULL));
} }
@ -801,7 +801,7 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr)
expand_ipbits(checkaddr,ipbits); expand_ipbits(checkaddr,ipbits);
if ( strcmp(checkaddr,ipaddr) == 0 ) if ( strcmp(checkaddr,ipaddr) == 0 )
{ {
//printf("valid ipaddr.(%s) MAXPEERS.%d\n",ipaddr,coin->MAXPEERS); printf("valid ipaddr.(%s) MAXPEERS.%d\n",ipaddr,coin->MAXPEERS);
if ( (iA= iguana_iAddrhashfind(coin,ipbits,1)) != 0 ) if ( (iA= iguana_iAddrhashfind(coin,ipbits,1)) != 0 )
{ {
if ( iA->status != IGUANA_PEER_CONNECTING && iA->status != IGUANA_PEER_READY && iA->status != IGUANA_PEER_ELIGIBLE ) if ( iA->status != IGUANA_PEER_CONNECTING && iA->status != IGUANA_PEER_READY && iA->status != IGUANA_PEER_ELIGIBLE )

Loading…
Cancel
Save