From 53bdbdb84c2204231f2c17597d29797e7b665349 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 15 Aug 2016 15:43:44 -0300 Subject: [PATCH] test --- iguana/iguana_recv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 2bac76b31..e2c7b0962 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -67,8 +67,8 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, char hexstr[65]; init_hexbytes_noT(hexstr,hash2.bytes,sizeof(hash2)); 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 ) + //printf("duplicate req %s or null addr.%p\n",bits256_str(hexstr,hash2),addr); + if ( (rand() % 10 ) != 0 ) return(0); } if ( addr->usock < 0 ) @@ -78,7 +78,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, { if ( checkbp->emitfinish != 0 || ((block= checkbp->blocks[j]) != 0 && block->mainchain != 0) ) { - printf("found valid [%d:%d] in blockreqPT\n",checkbp->hdrsi,j); + //printf("found valid [%d:%d] in blockreqPT\n",checkbp->hdrsi,j); return(0); } } @@ -86,8 +86,8 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, { if ( block != 0 && block->hdrsi != 0 && block->bundlei != 0 ) { - printf("found valid [%d:%d] in blockreqPT txvalid.%d\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1,block->txvalid); - if ( block->txvalid != 0 ) + //printf("found valid [%d:%d] in blockreqPT txvalid.%d\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1,block->txvalid); + if ( block->mainchain != 0 ) return(0); } } @@ -109,7 +109,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, bp->issued[bundlei] = addr->pendtime; if ( block != 0 ) block->issued = addr->pendtime; - //if ( 0 && coin->current == bp ) + if ( 0 && coin->current == bp ) printf("REQ.(%s) bundlei.%d hdrsi.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1); } else printf("MSG_BLOCK null datalen.%d\n",len); return(len); @@ -1209,7 +1209,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin) return(0); coin->lastreqtime = (uint32_t)time(NULL); //printf("reqblocks %u\n",coin->lastreqtime); - hdrsi = (coin->blocks.hwmchain.height+1) / coin->chain->bundlesize; + hdrsi = (coin->blocks.hwmchain.height + 1) / coin->chain->bundlesize; if ( (bp= coin->bundles[hdrsi]) != 0 ) { for (bundlei=0; bundleichain->bundlesize; bundlei++)