Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
943586751f
  1. 10
      iguana/iguana777.c
  2. 14
      iguana/iguana_recv.c

10
iguana/iguana777.c

@ -403,11 +403,6 @@ void iguana_coinloop(void *arg)
lastdisp = (uint32_t)now;
//printf("now.%u\n",now);
iguana_bundlestats(coin,str);
if ( str[0] != 0 )
{
if ( (rand() % 1000) == 0 )
myallocated(0,0);
}
//iguana_ramchainmerge(coin);
}
}// bp block needs mutex
@ -415,6 +410,11 @@ void iguana_coinloop(void *arg)
if ( flag == 0 )
{
//printf("IDLE\n");
if ( str[0] != 0 )
{
if ( (rand() % 1000) == 0 )
myallocated(0,0);
}
usleep(coin->polltimeout * 1000);
}
}

14
iguana/iguana_recv.c

@ -399,8 +399,14 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct iguana_info *coin,struct ig
match++;
}
}
if ( match == n && n == firstbp->n & firstbp->queued == 0 )
iguana_bundleQ(coin,firstbp,1000 + 10*(rand() % (int32_t)(1+sqrt(bp->bundleheight))));
if ( firstbp != 0 && match == n && n == firstbp->n )
{
if ( firstbp->queued == 0 )
{
printf("blockQ %d\n",firstbp->bundleheight);
iguana_bundleQ(coin,firstbp,1000 + 10*(rand() % (int32_t)(1+sqrt(bp->bundleheight))));
}
} else printf("match.%d vs n.%d bp->n.%d ht.%dn\n",match,n,firstbp->n,firstbp->bundleheight);
}
return(req);
}
@ -823,8 +829,8 @@ int32_t iguana_processrecv(struct iguana_info *coin) // single threaded
if ( bp != 0 )
{
coin->backstopmillis = OS_milliseconds();
iguana_blockQ(coin,bp,bundlei,iguana_blockhash(coin,coin->backstop),1);
//if ( (rand() % 100) == 0 )
iguana_blockQ(coin,bp,bundlei,iguana_blockhash(coin,coin->backstop),0);
if ( (rand() % 100) == 0 )
printf("MAINCHAIN.%d threshold %.3f %.3f lag %.3f\n",coin->blocks.hwmchain.height+1,threshold,coin->backstopmillis,lag);
}
}

Loading…
Cancel
Save