From d76944a4c255f9817e15f38b7f28eb76e4b3e8ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 6 Apr 2016 18:18:38 -0500 Subject: [PATCH] test --- iguana/iguana_bundles.c | 14 ++++++++------ iguana/iguana_ramchain.c | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 479a5699d..3d0ef4dfb 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -603,7 +603,7 @@ int32_t iguana_bundlerequests(struct iguana_info *coin,uint8_t missings[IGUANA_M int32_t iguana_bundleready(struct iguana_info *coin,struct iguana_bundle *bp) { - int32_t i,ready,valid; char fname[1024]; void *ptr; long filesize; struct iguana_block *block; int32_t sum[0x100],counts[0x100]; + int32_t i,ready,valid,checki,hdrsi; char fname[1024]; struct iguana_block *block; int32_t sum[0x100],counts[0x100]; static bits256 zero; FILE *fp; memset(sum,0,sizeof(sum)); memset(counts,0,sizeof(counts)); for (i=ready=0; in; i++) @@ -624,12 +624,14 @@ int32_t iguana_bundleready(struct iguana_info *coin,struct iguana_bundle *bp) } else { - if ( (ptr= iguana_bundlefile(coin,fname,&filesize,bp,i)) != 0 ) + checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,block->RO.hash2,zero,1,0); + if ( (fp= fopen(fname,"rb")) != 0 ) { - munmap(ptr,filesize); - ready++; - } - else iguana_blockunmark(coin,block,bp,i,0); + fseek(fp,0,SEEK_END); + if ( ftell(fp) > sizeof(struct iguana_ramchaindata) ) + ready++; + fclose(fp); + } else iguana_blockunmark(coin,block,bp,i,0); } } else diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index e918f1264..e23294f6d 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -585,7 +585,7 @@ void *_iguana_ramchain_setptrs(RAMCHAIN_PTRPS,struct iguana_ramchaindata *rdata) printf("_iguana_ramchain_setptrs: null rdata\n"); return(0); } - printf("rdata.%p\n",rdata); + //printf("rdata.%p\n",rdata); *B = (void *)(long)((long)rdata + (long)rdata->Boffset); *T = (void *)(long)((long)rdata + (long)rdata->Toffset); *Kspace = (void *)(long)((long)rdata + (long)rdata->Koffset); @@ -615,6 +615,7 @@ void *_iguana_ramchain_setptrs(RAMCHAIN_PTRPS,struct iguana_ramchaindata *rdata) *S = (void *)(long)((long)rdata + (long)rdata->Soffset); *Ux = 0, *Sx = 0, *P = 0, *X = 0, *A = 0, *TXbits = 0, *PKbits = 0; //*U2 = 0, *P2 = 0, } + return(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)