From 3ac19f3d59ad4efa669b01fb6a333e935c5df73a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Apr 2016 18:33:06 -0500 Subject: [PATCH] test --- iguana/iguana_accept.c | 5 ++--- iguana/iguana_msg.c | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_accept.c b/iguana/iguana_accept.c index 3a7b9ae2d..8203f400a 100755 --- a/iguana/iguana_accept.c +++ b/iguana/iguana_accept.c @@ -213,7 +213,7 @@ int32_t iguana_peerinvrequest(struct iguana_info *coin,struct iguana_peer *addr, int32_t iguana_peeraddrrequest(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *space,int32_t spacesize) { - int32_t i,iter,n,max,sendlen; uint64_t x; struct iguana_msghdr H; struct iguana_msgaddress A; struct iguana_peer *tmpaddr; + int32_t i,iter,n,max,sendlen; uint64_t x; struct iguana_msghdr H; struct iguana_peer *tmpaddr; sendlen = 0; max = (IGUANA_MINPEERS + IGUANA_MAXPEERS) / 2; if ( max > coin->peers.numranked ) @@ -224,8 +224,7 @@ int32_t iguana_peeraddrrequest(struct iguana_info *coin,struct iguana_peer *addr { for (i=n=0; ipeers.ranked[i]) != 0 && ((iter == 0 && tmpaddr->supernet != 0) || (iter == 1 && tmpaddr->supernet == 0)) ) + if ( (tmpaddr= coin->peers.ranked[i]) != 0 && ((iter == 0 && tmpaddr->supernet != 0) || (iter == 1 && tmpaddr->supernet == 0)) && tmpaddr->ipaddr[0] != 0 ) { sendlen += iguana_rwaddr(1,&space[sizeof(H) + sendlen],&tmpaddr->A,(int32_t)tmpaddr->protover); x++; diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index 9f1e62a71..d8d5d43c5 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -265,6 +265,7 @@ int32_t iguana_send_ping(struct iguana_info *coin,struct iguana_peer *addr) addr->pingtime = (uint32_t)time(NULL); } printf("pingnonce.%llx from (%s)\n",(long long)nonce,addr->ipaddr); + iguana_queue_send(coin,addr,0,serialized,"getaddr",0,0,0); len = iguana_rwnum(1,&serialized[sizeof(struct iguana_msghdr)],sizeof(uint64_t),&nonce); if ( addr->supernet != 0 ) iguana_send_supernet(coin,addr,SUPERNET_GETPEERSTR,0); @@ -540,7 +541,7 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc strcpy(addr->lastcommand,H->command); } retval = 0; - printf("iguana_msgparser from (%s) parse.(%s) len.%d\n",addr->ipaddr,H->command,recvlen); + //printf("iguana_msgparser from (%s) parse.(%s) len.%d\n",addr->ipaddr,H->command,recvlen); if ( strncmp(H->command,"SuperNET",strlen("SuperNET")) == 0 ) { addr->supernet = 1;