From e84c5ef544feb2ae00e90661f3ed33904c8f1b85 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Jan 2016 22:36:24 -0300 Subject: [PATCH] test --- iguana/iguana_peers.c | 11 +++++------ iguana/main.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index f42b9fb6a..612ebed23 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -316,7 +316,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); opt = 1; slen = sizeof(opt); - printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen)); + //printf("set keepalive.%d\n",setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,(void *)&opt,slen)); if ( 0 && bindflag != 0 ) { opt = 0; @@ -365,8 +365,8 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s } else { - if ( addr->relayflag == 0 ) - return(-1); + //if ( addr->relayflag == 0 ) + // return(-1); } if ( strcmp((char *)&serialized[4],"ping") == 0 ) addr->sendmillis = OS_milliseconds(); @@ -436,7 +436,7 @@ int32_t iguana_recv(int32_t usock,uint8_t *recvbuf,int32_t len) { if ( (recvlen= (int32_t)recv(usock,recvbuf,remains,0)) < 0 ) { - printf("recv errno.%d %s\n",errno,strerror(errno)); + //printf("recv errno.%d %s\n",errno,strerror(errno)); if ( errno == EAGAIN ) { #ifdef IGUANA_DEDICATED_THREADS @@ -765,7 +765,6 @@ int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr) } else if ( packet->embargo.x == 0 ) { - iguana_send(coin,addr,packet->serialized,packet->datalen); myfree(packet,sizeof(*packet) + packet->datalen); return(1); @@ -927,7 +926,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr) // iguana_send_supernet(coin,addr,"{\"agent\":\"SuperNET\",\"method\":\"getpeers\"}",0); sleep(1); iguana_send_version(coin,addr,coin->myservices); - iguana_queue_send(coin,addr,0,serialized,"getaddr",0,0,0); + //iguana_queue_send(coin,addr,0,serialized,"getaddr",0,0,0); run = 0; while ( addr->usock >= 0 && addr->dead == 0 && coin->peers.shuttingdown == 0 ) { diff --git a/iguana/main.c b/iguana/main.c index a18d02b6e..26ead05c8 100644 --- a/iguana/main.c +++ b/iguana/main.c @@ -317,7 +317,7 @@ void iguana_main(void *arg) #ifdef __APPLE__ sleep(1); char *str; - if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":16,\"coin\":\"BTCD\",\"active\":1}"),0)) != 0 ) + if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1,\"maxpeers\":16,\"coin\":\"BTCD\",\"active\":1}"),0)) != 0 ) { printf("got.(%s)\n",str); free(str);