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 )