From 79627eb2a68cd0fb26cb47020a9753a4e0a80dac Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 18 Aug 2016 00:50:39 -0300 Subject: [PATCH] test --- iguana/iguana_peers.c | 2 +- iguana/iguana_realtime.c | 3 +++ iguana/iguana_recv.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index b905bca27..127b86def 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -631,7 +631,7 @@ void _iguana_processmsg(struct iguana_info *coin,int32_t usock,struct iguana_pee buf = mycalloc('p',1,len); if ( (recvlen= iguana_recv(addr->ipaddr,usock,buf,len)) < 0 ) { - printf("recv error on (%s) len.%d errno.%d (%s)\n",H.command,len,-recvlen,strerror(-recvlen)); + printf("%s recv error on (%s) len.%d errno.%d (%s)\n",addr->ipaddr,H.command,len,-recvlen,strerror(-recvlen)); if ( buf != _buf ) myfree(buf,len); //addr->dead = (uint32_t)time(NULL); diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index d55c79f2d..849980a1f 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -600,6 +600,7 @@ void iguana_RTblockadd(struct iguana_info *coin,struct iguana_block *block) if ( coin->RTrawdata[offset] == 0 ) coin->RTrawdata[offset] = iguana_RTrawdata(coin,block->RO.hash2,0,&coin->RTrecvlens[offset],&coin->RTnumtx[offset]); //printf("%s RTblockadd.%d offset.%d numtx.%d len.%d\n",coin->symbol,block->height,offset,coin->RTnumtx[offset],coin->RTrecvlens[offset]); + block->RO.txn_count = coin->RTnumtx[offset]; coin->RTblocks[offset] = block; iguana_RTiterate(coin,offset,block,1); } @@ -611,12 +612,14 @@ void iguana_RTblocksub(struct iguana_info *coin,struct iguana_block *block) if ( block != 0 ) { offset = block->height - coin->firstRTheight; + block->RO.txn_count = coin->RTnumtx[offset]; //printf("%s RTblocksub.%d offset.%d\n",coin->symbol,block->height,offset); iguana_RTiterate(coin,offset,block,-1); if ( coin->RTrawdata[offset] != 0 && coin->RTrecvlens[offset] != 0 ) iguana_RTunmap(coin->RTrawdata[offset],coin->RTrecvlens[offset]); coin->RTrawdata[offset] = 0; coin->RTrecvlens[offset] = 0; + coin->RTnumtx[offset] = 0; coin->RTblocks[offset] = 0; } } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 001011491..fbd5479b6 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -68,7 +68,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, if ( addr == 0 || memcmp(lastreq.bytes,hash2.bytes,sizeof(hash2)) == 0 || memcmp(lastreq2.bytes,hash2.bytes,sizeof(hash2)) == 0 ) { //printf("duplicate req %s or null addr.%p\n",bits256_str(hexstr,hash2),addr); - if ( (rand() % 10 ) != 0 ) + //if ( (rand() % 10 ) != 0 ) return(0); } if ( addr->usock < 0 )