From b9c916a14574b6f1950b589ba3c202916e23251b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Apr 2016 18:06:48 -0500 Subject: [PATCH] test --- iguana/iguana_ramchain.c | 5 +++-- iguana/iguana_unspents.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 76280f126..8de66cc7d 100755 --- a/iguana/iguana_ramchain.c +++ b/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) { + long err; void *destptr = (void *)(long)((long)dest + *offsetp); 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 ) { - if ( fwrite(srcptr,1,len,fp) != len ) - printf("iguana_ramchain_sizefunc: error writing len.%ld to fp.%p\n",(long)len,fp); + if ( (err= fwrite(srcptr,1,len,fp)) != len ) + 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); } (*offsetp) += len; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 080111323..1625e2793 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -907,7 +907,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp) } if ( ptr != 0 ) 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 ) exit(-1); return(-errs); @@ -1655,9 +1655,9 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin) int32_t i,j,n,iter; struct iguana_bundle *bp; if ( coin->spendvectorsaved != 0 ) return(0); - printf("SAVE SPEND VECTORS\n"); 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 (i=0; i