Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
91165a660f
  1. 60
      iguana/iguana777.c
  2. 2
      iguana/iguana_bundles.c
  3. 3
      iguana/iguana_msg.c
  4. 3
      iguana/iguana_unspents.c

60
iguana/iguana777.c

@ -474,46 +474,43 @@ void iguana_helper(void *arg)
iguana_utxogen(coin,helperid,coin->PREFETCHLAG < 0);
}
}
//if ( (type & (1 << 0)) != 0 )
n = queue_size(&bundlesQ);
for (iter=0; iter<n; iter++)
{
n = queue_size(&bundlesQ);
for (iter=0; iter<n; iter++)
if ( helperid >= n )
break;
if ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 )
{
if ( helperid >= n )
break;
if ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 )
idle = 0;
coin = ptr->coin;
if ( (bp= ptr->bp) != 0 && coin != 0 )
{
idle = 0;
coin = ptr->coin;
if ( (bp= ptr->bp) != 0 && coin != 0 )
if ( coin->polltimeout < polltimeout )
polltimeout = coin->polltimeout;
if ( coin->current != 0 && coin->current->hdrsi != coin->bundlescount-1 )
allcurrent = 0;
//printf("[%d] bundleQ size.%d lag.%ld\n",bp->hdrsi,queue_size(&bundlesQ),time(NULL) - bp->nexttime);
coin->numbundlesQ--;
if ( coin->started != 0 && (bp->nexttime == 0 || time(NULL) > bp->nexttime) && coin->active != 0 )
{
if ( coin->polltimeout < polltimeout )
polltimeout = coin->polltimeout;
if ( coin->current != 0 && coin->current->hdrsi != coin->bundlescount-1 )
allcurrent = 0;
//printf("[%d] bundleQ size.%d lag.%ld\n",bp->hdrsi,queue_size(&bundlesQ),time(NULL) - bp->nexttime);
coin->numbundlesQ--;
if ( coin->started != 0 && (bp->nexttime == 0 || time(NULL) > bp->nexttime) && coin->active != 0 )
{
flag += iguana_bundleiters(ptr->coin,&MEM,MEMB,bp,ptr->timelimit,IGUANA_DEFAULTLAG);
}
else
{
//printf("skip.[%d] nexttime.%u lag.%ld coin->active.%d\n",bp->hdrsi,bp->nexttime,time(NULL)-bp->nexttime,coin->active);
allcurrent--;
iguana_bundleQ(coin,bp,1000);
}
flag += iguana_bundleiters(ptr->coin,&MEM,MEMB,bp,ptr->timelimit,IGUANA_DEFAULTLAG);
}
else //if ( coin->active != 0 )
printf("helper missing param? %p %p %u\n",ptr->coin,bp,ptr->timelimit);
myfree(ptr,ptr->allocsize);
} else break;
}
else
{
//printf("skip.[%d] nexttime.%u lag.%ld coin->active.%d\n",bp->hdrsi,bp->nexttime,time(NULL)-bp->nexttime,coin->active);
allcurrent--;
iguana_bundleQ(coin,bp,1000);
}
}
else //if ( coin->active != 0 )
printf("helper missing param? %p %p %u\n",ptr->coin,bp,ptr->timelimit);
myfree(ptr,ptr->allocsize);
} else break;
}
//if ( (type & (1 << 1)) != 0 )
starttime = (uint32_t)time(NULL);
while ( time(NULL) < starttime+10 && (ptr= queue_dequeue(&validateQ,0)) != 0 )
{
printf("vQ.%d lag.%d\n",queue_size(&validateQ),(uint32_t)time(NULL)-starttime);
if ( (bp= ptr->bp) != 0 && (coin= ptr->coin) != 0 && coin->active != 0 )
{
printf("validate.[%d] %d vs %d\n",bp->hdrsi,coin->blocks.hwmchain.height/coin->chain->bundlesize,(coin->longestchain-1)/coin->chain->bundlesize);
@ -523,7 +520,6 @@ void iguana_helper(void *arg)
{
usleep(10000);
iguana_validateQ(coin,bp);
continue;
}
}
else if ( coin->active != 0 )

2
iguana/iguana_bundles.c

@ -1332,7 +1332,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
//sprintf(str+strlen(str),"%s.%-2d %s time %.2f files.%d Q.%d %d\n",coin->symbol,flag,str,(double)(time(NULL)-coin->starttime)/60.,coin->peers.numfiles,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ));
if ( time(NULL) > coin->lastdisp+3 && (strcmp(str,coin->lastdispstr) != 0 || time(NULL) > coin->lastdisp+60) )
{
printf("\n%s bQ.%d %d:%02d:%02d stuck.%d max.%d\n",str,queue_size(&bundlesQ),(int32_t)difft.x/3600,(int32_t)(difft.x/60)%60,(int32_t)difft.x%60,coin->stucktime!=0?(uint32_t)time(NULL) - coin->stucktime:0,coin->maxstuck);
printf("\n%s bQ.%d vQ.%d %d:%02d:%02d stuck.%d max.%d\n",str,queue_size(&bundlesQ),queue_size(&validateQ),(int32_t)difft.x/3600,(int32_t)(difft.x/60)%60,(int32_t)difft.x%60,coin->stucktime!=0?(uint32_t)time(NULL) - coin->stucktime:0,coin->maxstuck);
strcpy(coin->lastdispstr,str);
if ( (rand() % 100) == 0 )
myallocated(0,0);

3
iguana/iguana_msg.c

@ -170,7 +170,8 @@ void iguana_gotversion(struct iguana_info *coin,struct iguana_peer *addr,struct
addr->dead = (uint32_t)time(NULL);
if ( (vers->nServices & (1<<7)) == (1<<7) )
addr->supernet = 1;
printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet);
if ( addr->supernet != 0 )
printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet);
if ( (int32_t)vers->nStartingHeight > coin->longestchain )
{
if ( coin->badlongestchain != 0 && (int32_t)vers->nStartingHeight >= coin->badlongestchain )

3
iguana/iguana_unspents.c

@ -1103,8 +1103,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig
printf("iguana_balancegen.%d: no Xspendinds[%d]\n",bp->hdrsi,ramchain->numXspends);
return(-1);
}
//if ( coin->PREFETCHLAG > 0 )
iguana_ramchain_prefetch(coin,ramchain,0);
iguana_ramchain_prefetch(coin,ramchain,0);
fprintf(stderr,"BALANCEGEN.[%d] ",bp->hdrsi);
txidind = spendind = rdata->firsti;
for (i=0; i<bp->n; i++)

Loading…
Cancel
Save