Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
ec1de82813
  1. 7
      iguana/iguana_bundles.c

7
iguana/iguana_bundles.c

@ -497,9 +497,11 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
sortds(&coin->rankedbps[0][0],n,sizeof(coin->rankedbps[0])); sortds(&coin->rankedbps[0][0],n,sizeof(coin->rankedbps[0]));
for (i=0; i<coin->peers.numranked; i++) for (i=0; i<coin->peers.numranked; i++)
{ {
if ( (addr= coin->peers.ranked[i]) != 0 ) if ( (addr= coin->peers.ranked[i]) != 0 && addr->msgcounts.verack > 0 )
pend += addr->pendblocks; pend += addr->pendblocks;
} }
if ( pend > 0 )
{
origissue = (_IGUANA_MAXPENDING*coin->peers.numranked - pend); origissue = (_IGUANA_MAXPENDING*coin->peers.numranked - pend);
if ( origissue < 8 ) if ( origissue < 8 )
origissue = 8; origissue = 8;
@ -537,6 +539,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
//if ( flag != 0 ) //if ( flag != 0 )
printf("rem.%d issue.%d pend.%d | numranked.%d\n",n,origissue,pend,coin->peers.numranked); printf("rem.%d issue.%d pend.%d | numranked.%d\n",n,origissue,pend,coin->peers.numranked);
} }
}
coin->numremain = n; coin->numremain = n;
coin->blocksrecv = numrecv; coin->blocksrecv = numrecv;
char str2[65]; uint64_t tmp; int32_t diff,p = 0; struct tai difft,t = tai_now(); char str2[65]; uint64_t tmp; int32_t diff,p = 0; struct tai difft,t = tai_now();
@ -550,7 +553,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
difft.millis = ((double)tmp / 1000000.); difft.millis = ((double)tmp / 1000000.);
sprintf(str,"N[%d] h.%d r.%d c.%d:%d:%d s.%d E.%d:%d M.%d L.%d est.%d %s %d:%02d:%02d %03.3f peers.%d/%d",coin->bundlescount,numhashes,coin->blocksrecv,coin->numcached,numcached,coin->cachefreed,numsaved,numemit,coin->numreqsent,coin->blocks.hwmchain.height,coin->longestchain,coin->MAXBUNDLES,mbstr(str2,estsize),(int32_t)difft.x/3600,(int32_t)(difft.x/60)%60,(int32_t)difft.x%60,difft.millis,p,coin->MAXPEERS); sprintf(str,"N[%d] h.%d r.%d c.%d:%d:%d s.%d E.%d:%d M.%d L.%d est.%d %s %d:%02d:%02d %03.3f peers.%d/%d",coin->bundlescount,numhashes,coin->blocksrecv,coin->numcached,numcached,coin->cachefreed,numsaved,numemit,coin->numreqsent,coin->blocks.hwmchain.height,coin->longestchain,coin->MAXBUNDLES,mbstr(str2,estsize),(int32_t)difft.x/3600,(int32_t)(difft.x/60)%60,(int32_t)difft.x%60,difft.millis,p,coin->MAXPEERS);
//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)); //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 ( (rand() % 100) == 0 ) //if ( (rand() % 100) == 0 )
printf("%s\n",str); printf("%s\n",str);
strcpy(coin->statusstr,str); strcpy(coin->statusstr,str);
coin->estsize = estsize; coin->estsize = estsize;

Loading…
Cancel
Save