Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
11b156d09b
  1. 14
      iguana/iguana_recv.c

14
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 (; height<coin->bundlescount*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 )

Loading…
Cancel
Save