Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
253989e926
  1. 8
      iguana/iguana_bundles.c
  2. 17
      iguana/iguana_unspents.c

8
iguana/iguana_bundles.c

@ -978,11 +978,11 @@ double iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,d
void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
{
int32_t i,n,m,j,numv,count,starti,lasti,pending,capacity,dispflag,numutxo,numbalances,numrecv,done,numhashes,numcached,numsaved,numemit; struct iguana_block *block; bits256 hash2;
int32_t i,n,m,j,numv,numconverted,count,starti,lasti,pending,capacity,dispflag,numutxo,numbalances,numrecv,done,numhashes,numcached,numsaved,numemit; struct iguana_block *block; bits256 hash2;
int64_t spaceused=0,estsize = 0; struct iguana_bundle *currentbp,*lastbp,*bp,*lastpending = 0,*firstgap = 0; uint32_t now; double aveduration,recentduration = 0.;
now = (uint32_t)time(NULL);
dispflag = 1;//(rand() % 1000) == 0;
numrecv = numhashes = numcached = numsaved = numemit = done = numutxo = numbalances = 0;
numrecv = numhashes = numcached = numconverted = numsaved = numemit = done = numutxo = numbalances = 0;
count = coin->bundlescount;
currentbp = coin->current;
lastbp = coin->lastpending;
@ -994,6 +994,8 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
{
if ( (bp= coin->bundles[i]) != 0 )
{
if ( bp->converted != 0 )
numconverted++;
if ( bp == coin->current && coin->blocks.hwmchain.height >= bp->bundleheight && coin->blocks.hwmchain.height < bp->bundleheight+bp->n )
{
for (j=coin->blocks.hwmchain.height-bp->bundleheight+1; j<=bp->n; j++)
@ -1164,7 +1166,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
coin->stucktime = coin->stuckiters = 0;
if ( coin->stucktime != 0 && time(NULL)-coin->stucktime > coin->maxstuck )
coin->maxstuck = (uint32_t)time(NULL) - coin->stucktime;
sprintf(str,"%s.RT%d u.%d b.%d v.%d/%d (%d+%d/%d 1st.%d).s%d to %d N[%d] h.%d r.%d c.%d s.%d d.%d E.%d maxB.%d peers.%d/%d Q.(%d %d) L.%d [%d:%d] M.%d %s",coin->symbol,coin->RTheight,numutxo,numbalances,numv,coin->pendbalances,firstgap!=0?firstgap->numcached:-1,firstgap!=0?firstgap->numsaved:-1,firstgap!=0?firstgap->numhashes:-1,firstgap!=0?firstgap->hdrsi:-1,firstgap!=0?firstgap->numspec:-1,coin->lastpending!=0?coin->lastpending->hdrsi:0,count,numhashes,coin->blocksrecv,numcached,numsaved,done,numemit,coin->MAXBUNDLES,p,coin->MAXPEERS,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ),coin->longestchain,coin->blocks.hwmchain.height/coin->chain->bundlesize,coin->blocks.hwmchain.height%coin->chain->bundlesize,coin->blocks.hwmchain.height,bits256_str(str5,coin->blocks.hwmchain.RO.hash2));
sprintf(str,"%s.RT%d u.%d b.%d/%d v.%d/%d (%d+%d/%d 1st.%d).s%d to %d N[%d] h.%d r.%d c.%d s.%d d.%d E.%d maxB.%d peers.%d/%d Q.(%d %d) L.%d [%d:%d] M.%d %s",coin->symbol,coin->RTheight,numutxo,numbalances,numconverted,numv,coin->pendbalances,firstgap!=0?firstgap->numcached:-1,firstgap!=0?firstgap->numsaved:-1,firstgap!=0?firstgap->numhashes:-1,firstgap!=0?firstgap->hdrsi:-1,firstgap!=0?firstgap->numspec:-1,coin->lastpending!=0?coin->lastpending->hdrsi:0,count,numhashes,coin->blocksrecv,numcached,numsaved,done,numemit,coin->MAXBUNDLES,p,coin->MAXPEERS,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ),coin->longestchain,coin->blocks.hwmchain.height/coin->chain->bundlesize,coin->blocks.hwmchain.height%coin->chain->bundlesize,coin->blocks.hwmchain.height,bits256_str(str5,coin->blocks.hwmchain.RO.hash2));
//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) )
{

17
iguana/iguana_unspents.c

@ -1724,7 +1724,7 @@ int32_t iguana_spendvectorconvs(struct iguana_info *coin,struct iguana_bundle *r
int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int32_t startheight,int32_t endheight)
{
int32_t converted,retval=-1,i,n,flag = 0;
int32_t converted,retval=-1,i,n,flag = 0; int64_t total_tmpspends; static int64_t total;
if ( bp->balancefinish > 1 )
{
printf("make sure DB files have this bp.%d\n",bp->hdrsi);
@ -1743,11 +1743,18 @@ int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int
else
{
n = coin->bundlescount;
for (i=0; i<n; i++)
if ( coin->bundles[i] == 0 || coin->bundles[i]->converted == 0 )
for (i=total_tmpspends=0; i<n; i++)
{
if ( coin->bundles[i] == 0 )
{
total_tmpspends += coin->bundles[i]->numtmpspends;
if ( coin->bundles[i]->converted == 0 )
break;
printf("[%d] converted.%d balance calc.%d of %d\n",i,converted,i,n);
if ( i == n )
}
}
total += converted;
printf("[%4d] converted.%-7d balance calc.%-4d of %4d | total.%llu of %llu\n",i,converted,i,n,(long long)total,(long long)total_tmpspends);
if ( i == n-1 )
iguana_spendvectorsaves(coin);
}
} //else printf("error with invalid tmpspends.[%d]\n",bp->hdrsi), getchar();

Loading…
Cancel
Save