Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
faf2569472
  1. 2
      iguana/iguana777.c
  2. 2
      iguana/iguana_msg.c
  3. 7
      iguana/iguana_peers.c
  4. 2
      iguana/iguana_recv.c

2
iguana/iguana777.c

@ -235,7 +235,7 @@ uint32_t iguana_updatemetrics(struct iguana_info *coin)
{
expand_ipbits(ipaddr,(uint32_t)addr->ipbits);
fprintf(fp,"%s\n",ipaddr);
if ( addr->msgcounts.verack == 0 )
if ( 0 && addr->msgcounts.verack == 0 )
{
printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
iguana_send_version(coin,addr,coin->myservices);

2
iguana/iguana_msg.c

@ -171,7 +171,7 @@ void iguana_gotversion(struct iguana_info *coin,struct iguana_peer *addr,struct
addr->dead = (uint32_t)time(NULL);
if ( (vers->nServices & (1<<7)) == (1<<7) )
addr->supernet = 1;
//if ( addr->supernet != 0 )
if ( addr->supernet != 0 )
printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet);
if ( (int32_t)vers->nStartingHeight > coin->longestchain )
{

7
iguana/iguana_peers.c

@ -466,7 +466,8 @@ int32_t iguana_queue_send(struct iguana_info *coin,struct iguana_peer *addr,int3
}
else if ( forceflag != 0 )
{
return(iguana_send(coin,addr,serialized,len));
printf("forceflag not supported\n");
//return(iguana_send(coin,addr,serialized,len));
}
if ( (datalen= iguana_sethdr((void *)serialized,coin->chain->netmagic,cmd,&serialized[sizeof(struct iguana_msghdr)],len)) < 0 )
@ -500,7 +501,7 @@ int32_t iguana_recv(char *ipaddr,int32_t usock,uint8_t *recvbuf,int32_t len)
{
if ( errno == EAGAIN )
{
//printf("%s recv errno.%d %s\n",ipaddr,errno,strerror(errno));
//printf("%s recv errno.%d %s len.%d remains.%d\n",ipaddr,errno,strerror(errno),len,remains);
//printf("EAGAIN for len %d, remains.%d\n",len,remains);
sleep(1);
} else return(-errno);
@ -1287,7 +1288,7 @@ void iguana_peersloop(void *ptr)
}
if ( flag == 0 )
{
if ( time(NULL) > lastping+1 )
if ( time(NULL) > lastping+1 && addr->supernet != 0 )
iguana_send_supernet(coin,addr,SUPERNET_GETPEERSTR,0);
usleep(1000);
}

2
iguana/iguana_recv.c

@ -87,7 +87,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
}
if ( addr->msgcounts.verack == 0 )
{
//printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind);
iguana_send_version(coin,addr,coin->myservices);
return(-1);
}

Loading…
Cancel
Save