From 83406c627d7b3db9d0e10d91a11e3ae453da4fe9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 12 Sep 2016 10:24:44 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 8 ++++++-- iguana/iguana_peers.c | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 8208173a4..30db0d692 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -191,14 +191,18 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ cmd[6] = 'E', cmd[7] = 'T'; HASH_ITER(hh,myinfo->allcoins,coin,tmp) { - printf("basilisk iter.(%s) -> (%s)\n",coin->symbol,destipaddr); + printf("basilisk iter.(%s) -> (%s) %p\n",coin->symbol,destipaddr,coin->peers); if ( coin->peers == 0 ) continue; + printf("basilisk iter.(%s) -> (%s) %llx\n",coin->symbol,destipaddr,(long long)calc_ipbits(destipaddr)); if ( (addr= iguana_peerslot(coin,calc_ipbits(destipaddr),0)) != 0 ) { printf("RET [%d] to %s\n",datalen,addr->ipaddr); + fprintf(stderr,"RET [%d] to %s\n",datalen,addr->ipaddr); return(iguana_queue_send(addr,delaymillis,&data[-(int32_t)sizeof(struct iguana_msghdr)],cmd,datalen)); - } else printf("cant find (%s) in (%s)\n",addr->ipaddr,coin->symbol); + } + printf("cant find (%s) in (%s)\n",addr->ipaddr,coin->symbol); + fprintf(stderr,"cant find (%s) in (%s)\n",addr->ipaddr,coin->symbol); } printf("cant find (%s) to RET to\n",addr->ipaddr); return(-1); diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index fa3625608..97fc1504b 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -517,7 +517,7 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s } } addr->totalsent += len; - if ( 0 && addr->msgcounts.verack == 0 ) + if ( addr->basilisk != 0 ) printf("verack.%d (%s) sent.%d bytes to %s\n",addr->msgcounts.verack,cmdstr,len,addr->ipaddr); return(len); } @@ -546,7 +546,8 @@ int32_t iguana_queue_send(struct iguana_peer *addr,int32_t delay,uint8_t *serial packet->embargo.millis += delay; } memcpy(packet->serialized,serialized,datalen); - //printf("%p queue send.(%s) %d to (%s)\n",packet,serialized+4,datalen,addr->ipaddr); + if ( addr->basilisk != 0 ) + printf("%p queue send.(%s) %d to (%s)\n",packet,serialized+4,datalen,addr->ipaddr); queue_enqueue("sendQ",&addr->sendQ,&packet->DL,0); return(datalen); }