From 11b156d09b8eda56d275d6ff1c405b202a65b7f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Jan 2016 10:03:11 -0300 Subject: [PATCH] test --- iguana/iguana_recv.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index fce5dab55..1a12f1544 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -677,16 +677,16 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) { int32_t bundlei; incr = coin->peers.numranked == 0 ? coin->MAXPEERS : coin->peers.numranked; - if ( (rand() % 100) < 25 ) + if ( (rand() % 100) < 50 ) + height = addr->rank * _IGUANA_MAXPENDING; + else if ( (rand() % 100) < 50 ) + height = addr->addrind + (addr->rank * (coin->longestchain - coin->blocks.hwmchain.height) / (coin->peers.numranked+1)); + else if ( (rand() % 100) < 50 ) { height = (addr->lastheight + 1); if ( height >= coin->longestchain-coin->chain->bundlesize ) - height = coin->blocks.hwmchain.height + addr->rank*incr*_IGUANA_MAXPENDING; + height = addr->rank*incr*_IGUANA_MAXPENDING; } - else if ( (rand() % 100) < 10 ) - height = addr->rank * _IGUANA_MAXPENDING; - else if ( (rand() % 100) < 90 ) - height = addr->addrind + (addr->rank * (coin->longestchain - coin->blocks.hwmchain.height) / (coin->peers.numranked+1)); else { height = coin->longestchain - (rand() % incr) * 1000; @@ -695,6 +695,8 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) } for (; heightbundlescount*coin->chain->bundlesize; height+=incr) { + if ( height > coin->longestchain ) + height = addr->rank*incr*_IGUANA_MAXPENDING; if ( height > addr->lastheight ) addr->lastheight = height; if ( (bp= coin->bundles[height/coin->chain->bundlesize]) != 0 && bp->emitfinish == 0 )