Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
b9c916a145
  1. 5
      iguana/iguana_ramchain.c
  2. 6
      iguana/iguana_unspents.c

5
iguana/iguana_ramchain.c

@ -612,6 +612,7 @@ void _iguana_ramchain_setptrs(RAMCHAIN_PTRPS,struct iguana_ramchaindata *rdata)
void *iguana_ramchain_offset(void *dest,uint8_t *lhash,FILE *fp,uint64_t fpos,void *srcptr,uint64_t *offsetp,uint64_t len,uint64_t srcsize) void *iguana_ramchain_offset(void *dest,uint8_t *lhash,FILE *fp,uint64_t fpos,void *srcptr,uint64_t *offsetp,uint64_t len,uint64_t srcsize)
{ {
long err;
void *destptr = (void *)(long)((long)dest + *offsetp); void *destptr = (void *)(long)((long)dest + *offsetp);
if ( (lhash != 0 || fp != 0) && (*offsetp + len) > srcsize ) if ( (lhash != 0 || fp != 0) && (*offsetp + len) > srcsize )
{ {
@ -625,8 +626,8 @@ void *iguana_ramchain_offset(void *dest,uint8_t *lhash,FILE *fp,uint64_t fpos,vo
} }
else if ( fp != 0 ) else if ( fp != 0 )
{ {
if ( fwrite(srcptr,1,len,fp) != len ) if ( (err= fwrite(srcptr,1,len,fp)) != len )
printf("iguana_ramchain_sizefunc: error writing len.%ld to fp.%p\n",(long)len,fp); printf("iguana_ramchain_sizefunc: error.%ld writing len.%ld to fp.%p\n",err,(long)len,fp);
//else printf("fp.(%ld <- %d) ",ftell(fp),(int32_t)len); //else printf("fp.(%ld <- %d) ",ftell(fp),(int32_t)len);
} }
(*offsetp) += len; (*offsetp) += len;

6
iguana/iguana_unspents.c

@ -907,7 +907,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp)
} }
if ( ptr != 0 ) if ( ptr != 0 )
myfree(ptr,sizeof(*ptr) * n); myfree(ptr,sizeof(*ptr) * n);
printf("[%4d].%-6d duration.%-2d [millis %8.3f] vectors %-6d errs.%d [%5.2f%%] %d %9s of %d\n",bp->hdrsi,bp->numtmpspends,(uint32_t)time(NULL)-starttime,OS_milliseconds()-startmillis,spendind,errs,100.*(double)emitted/(total+1),emit,mbstr(str,sizeof(*ptr) * emit),n); printf("[%4d].%-6d duration.%-2d [millis %8.3f] vectors %-6d errs.%d [%5.2f%%] %7d %9s of %d\n",bp->hdrsi,bp->numtmpspends,(uint32_t)time(NULL)-starttime,OS_milliseconds()-startmillis,spendind,errs,100.*(double)emitted/(total+1),emit,mbstr(str,sizeof(*ptr) * emit),n);
if ( errs != 0 ) if ( errs != 0 )
exit(-1); exit(-1);
return(-errs); return(-errs);
@ -1655,9 +1655,9 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin)
int32_t i,j,n,iter; struct iguana_bundle *bp; int32_t i,j,n,iter; struct iguana_bundle *bp;
if ( coin->spendvectorsaved != 0 ) if ( coin->spendvectorsaved != 0 )
return(0); return(0);
printf("SAVE SPEND VECTORS\n");
coin->spendvectorsaved = 1; coin->spendvectorsaved = 1;
n = coin->bundlescount; n = coin->bundlescount - 1;
printf("SAVE SPEND VECTORS %d of %d\n",n,coin->bundlescount);
for (iter=0; iter<2; iter++) for (iter=0; iter<2; iter++)
{ {
for (i=0; i<n; i++) for (i=0; i<n; i++)

Loading…
Cancel
Save