From 53be3f78f69a291e669414b36ff0cb80d25c533c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Mar 2016 21:31:44 -0300 Subject: [PATCH] test --- iguana/iguana_bundles.c | 13 +++++++------ iguana/iguana_msg.c | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 4b9222441..2864772ef 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -445,7 +445,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int else if ( block->peerid > 0 ) { total++; - if ( block->fpipbits != 0 )//&& block->fpos >= 0 ) + if ( iguana_blockstatus(coin,block) != 0 || bp->speculativecache[i] != 0 )//block->fpipbits != 0 )//&& block->fpos >= 0 ) { donecounts[block->peerid - 1]++; if ( donecounts[block->peerid - 1] > doneval ) @@ -935,7 +935,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru counter = iguana_bundleissue(coin,bp,max,timelimit); //if ( bp == coin->current && coin->isRT == 0 ) // bp->nexttime--; - if ( 0 && bp == coin->current && counter > 0 ) + if ( bp->isRT == 0 && bp == coin->current && counter > 0 ) printf("ITER.rt%d now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->isRT,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount); if ( bp->hdrsi == starti && bp->isRT == 0 ) { @@ -1074,19 +1074,20 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) } // else break; } } - /*else if ( 0 && bp == coin->current ) + else if ( bp == coin->current ) { for (j=0; jn; j++) - if ( (block= bp->blocks[j]) != 0 && (block->RO.recvlen == 0 || block->fpipbits == 0 || block->fpos < 0) && time(NULL) > block->issued+3 && (rand() % 10) == 0 ) + if ( (block= bp->blocks[j]) != 0 && (block->RO.recvlen == 0 || block->fpipbits == 0 || block->fpos < 0) && time(NULL) > block->issued+30 ) { - if ( 0 && (r= coin->peers.numranked) != 0 && (addr= coin->peers.ranked[rand() % r]) != 0 && addr->dead == 0 && addr->usock >= 0 ) + struct iguana_peer *addr; int32_t r; + if ( 1 && (r= coin->peers.numranked) != 0 && (addr= coin->peers.ranked[rand() % r]) != 0 && addr->dead == 0 && addr->usock >= 0 ) iguana_sendblockreqPT(coin,addr,bp,j,block->RO.hash2,0); printf("currentstop [%d:%d]\n",bp->hdrsi,j); iguana_blockQ("currentstop",coin,bp,j,block->RO.hash2,0); block->issued = (uint32_t)time(NULL); break; } - }*/ + } if ( bp->speculative != 0 && numcached == bp->n ) { hash2 = bp->hashes[0]; diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index 716b1f583..ba4ac77e5 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -171,9 +171,9 @@ void iguana_gotversion(struct iguana_info *coin,struct iguana_peer *addr,struct if ( (vers->nServices & (1<<7)) == (1<<7) ) addr->supernet = 1; printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet); - if ( vers->nStartingHeight > coin->longestchain ) + if ( (int32_t)vers->nStartingHeight > coin->longestchain ) { - if ( coin->badlongestchain != 0 && vers->nStartingHeight >= coin->badlongestchain ) + if ( coin->badlongestchain != 0 && (int32_t)vers->nStartingHeight >= coin->badlongestchain ) { printf("peer.(%s) gives badlongestchain.%d\n",addr->ipaddr,vers->nStartingHeight); addr->dead = 1;