Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e89441c160
  1. 2
      iguana/iguana777.c
  2. 12
      iguana/iguana_bundles.c
  3. 9
      iguana/iguana_recv.c
  4. 6
      iguana/main.c

2
iguana/iguana777.c

@ -502,7 +502,7 @@ void iguana_coinloop(void *arg)
coin->polltimeout = 100;
coin->MAXPEERS = 8;
}
if ( coin->isRT != 0 && coin->numverified >= coin->bundlescount-1 )
if ( coin->isRT != 0 && coin->current != 0 && coin->numverified >= coin->current->hdrsi )
{
static int32_t saved;
if ( saved++ == 0 )

12
iguana/iguana_bundles.c

@ -379,10 +379,12 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
else starti = 0;
lag = (bp->hdrsi - starti);
lag *= lag;
if ( lag < 30 )
lag = 30;
else if ( lag > 600 )
lag = 600;
if ( (i= sqrt(bp->hdrsi)) < 2 )
i = 2;
if ( lag < i )
lag = i;
else if ( lag > 10*i )
lag = 10*i;
if ( (numpeers= coin->peers.numranked) > 8 )//&& bp->currentflag < bp->n )
{
if ( bp->currentflag == 0 )
@ -714,7 +716,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int
}
retval = 1;
}
else if ( bp->hdrsi >= starti && bp->hdrsi <= starti+range )
else if ( bp->hdrsi > starti && bp->hdrsi <= starti+range )
{
max = sqrt(bp->n) - (bp->n/coin->MAXBUNDLES)*(bp->hdrsi - starti);
if ( max > 100 )

9
iguana/iguana_recv.c

@ -861,6 +861,13 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
printf("MAINCHAIN skip issue %d\n",bundlei+1);
iguana_blockQ("mainskip",coin,bp,bundlei,bp->hashes[bundlei+1],0);
}
else if ( bp != 0 && time(NULL) > bp->hdrtime+10 )
{
char str[65];
printf("MAINCHAIN gethdr %d\n",bp->bundleheight);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
bp->hdrtime = (uint32_t)time(NULL);
}
}
}
}
@ -927,7 +934,7 @@ int32_t iguana_reqhdrs(struct iguana_info *coin)
int32_t i,lag,n = 0; struct iguana_bundle *bp; char hashstr[65];
if ( queue_size(&coin->hdrsQ) == 0 )
{
//if ( iguana_needhdrs(coin) > 0 )
if ( iguana_needhdrs(coin) > 0 )
{
for (i=0; i<coin->bundlescount; i++)
{

6
iguana/main.c

@ -325,7 +325,7 @@ void sigcontinue_func() { printf("\nSIGCONT\n"); signal(SIGCONT,sigcontinue_func
void mainloop(struct supernet_info *myinfo)
{
int32_t i,flag; struct iguana_info *coin; struct iguana_helper *ptr;
int32_t i,flag; struct iguana_info *coin; struct iguana_helper *ptr; struct iguana_bundle *bp;
sleep(3);
printf("mainloop\n");
while ( 1 )
@ -334,9 +334,9 @@ void mainloop(struct supernet_info *myinfo)
if ( 1 )
{
for (i=0; i<IGUANA_MAXCOINS; i++)
if ( (coin= Coins[i]) != 0 && coin->active != 0 )//&& (bp= coin->current) != 0 )
if ( (coin= Coins[i]) != 0 && coin->active != 0 && (bp= coin->current) != 0 )
{
//iguana_bundleissue(coin,bp,bp->n,100);
iguana_bundleissue(coin,bp,bp->n,100);
if ( (ptr= queue_dequeue(&balancesQ,0)) != 0 )
{
if ( ptr->bp != 0 && ptr->coin != 0 )

Loading…
Cancel
Save