Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
c58dc19715
  1. 5
      iguana/iguana777.c
  2. 8
      iguana/iguana_unspents.c

5
iguana/iguana777.c

@ -369,8 +369,8 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert
if ( incr < 1 ) if ( incr < 1 )
incr = 1; incr = 1;
} }
if ( helperid >= incr ) if ( helperid < incr )
return(0); {
max = coin->bundlescount; max = coin->bundlescount;
if ( coin->bundles[max-1] != 0 && coin->bundles[max-1]->emitfinish <= 1 ) if ( coin->bundles[max-1] != 0 && coin->bundles[max-1]->emitfinish <= 1 )
max--; max--;
@ -393,6 +393,7 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert
} else printf("UTXO gen.[%d] utxo error\n",bp->hdrsi); } else printf("UTXO gen.[%d] utxo error\n",bp->hdrsi);
} }
} }
}
while ( (n= iguana_utxofinished(coin)) < max ) while ( (n= iguana_utxofinished(coin)) < max )
{ {
//printf("helperid.%d utxofinished.%d vs %d\n",helperid,n,max); //printf("helperid.%d utxofinished.%d vs %d\n",helperid,n,max);

8
iguana/iguana_unspents.c

@ -141,7 +141,7 @@ int32_t iguana_alloccacheT(struct iguana_info *coin,struct iguana_ramchain *ramc
ramchain->cacheT = calloc(1,tlen); ramchain->cacheT = calloc(1,tlen);
memcpy(ramchain->cacheT,T,tlen); memcpy(ramchain->cacheT,T,tlen);
total += tlen; total += tlen;
char str[65]; printf("alloc.[%d] cacheT.%p[%d] total %s\n",ramchain->H.data->height/coin->chain->bundlesize,ramchain->cacheT,tlen,mbstr(str,total)); //char str[65]; printf("alloc.[%d] cacheT.%p[%d] total %s\n",ramchain->H.data->height/coin->chain->bundlesize,ramchain->cacheT,tlen,mbstr(str,total));
return(tlen); return(tlen);
} }
return(-1); return(-1);
@ -2010,10 +2010,11 @@ int32_t iguana_bundlevalidate(struct iguana_info *coin,struct iguana_bundle *bp,
static int32_t totalerrs,totalvalidated; static int32_t totalerrs,totalvalidated;
FILE *fp; char fname[1024]; uint8_t *blockspace; uint32_t now = (uint32_t)time(NULL); FILE *fp; char fname[1024]; uint8_t *blockspace; uint32_t now = (uint32_t)time(NULL);
int32_t i,max,len,errs = 0; int64_t total = 0; int32_t i,max,len,errs = 0; int64_t total = 0;
//printf("validate.[%d]\n",bp->hdrsi); printf("validate.[%d]\n",bp->hdrsi);
if ( bp->validated <= 1 || forceflag != 0 ) if ( bp->validated <= 1 || forceflag != 0 )
{ {
sprintf(fname,"%s/%s/validated/%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight); sprintf(fname,"%s/%s/validated/%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight);
printf("validatefname.(%s)\n",fname);
if ( (fp= fopen(fname,"rb")) != 0 ) if ( (fp= fopen(fname,"rb")) != 0 )
{ {
if ( forceflag == 0 ) if ( forceflag == 0 )
@ -2022,7 +2023,7 @@ int32_t iguana_bundlevalidate(struct iguana_info *coin,struct iguana_bundle *bp,
{ {
printf("error reading.(%s)\n",fname); printf("error reading.(%s)\n",fname);
total = bp->validated = 0; total = bp->validated = 0;
} //else printf("(%s) total.%d validated.%u\n",fname,(int32_t)total,bp->validated); } else printf("(%s) total.%d validated.%u\n",fname,(int32_t)total,bp->validated);
} else OS_removefile(fname,1); } else OS_removefile(fname,1);
fclose(fp); fclose(fp);
} }
@ -2032,6 +2033,7 @@ int32_t iguana_bundlevalidate(struct iguana_info *coin,struct iguana_bundle *bp,
blockspace = calloc(1,max); blockspace = calloc(1,max);
for (i=0; i<bp->n; i++) for (i=0; i<bp->n; i++)
{ {
printf("i.%d: request\n",i);
if ( (len= iguana_peerblockrequest(coin,blockspace,max,0,bp->hashes[i],1)) < 0 ) if ( (len= iguana_peerblockrequest(coin,blockspace,max,0,bp->hashes[i],1)) < 0 )
{ {
errs++; errs++;

Loading…
Cancel
Save