From faf2569472e48b5f5c5c75aa02b5140a2ab66d3d Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 11 May 2016 02:55:04 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 2 +- iguana/iguana_msg.c | 2 +- iguana/iguana_peers.c | 7 ++++--- iguana/iguana_recv.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index c7ff74be9..c1428f139 100755 --- a/iguana/iguana777.c +++ b/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); diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index fcfe818fe..01bd96648 100755 --- a/iguana/iguana_msg.c +++ b/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 ) { diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index da1b3d7a7..9dd58dbe0 100755 --- a/iguana/iguana_peers.c +++ b/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); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 7005ed871..837fb45e6 100755 --- a/iguana/iguana_recv.c +++ b/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); }