diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 8d2e79ba1..d2eaa2a20 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -851,21 +851,25 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru counter = iguana_bundleissue(coin,bp,max,timelimit); if ( bp->hdrsi == starti && counter > 0 ) printf("ITER now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount); - for (bundlei=0; bundlein; bundlei++) + if ( coin->blocks.hwmchain.height > coin->chain->bundlesize && bp->hdrsi == coin->blocks.hwmchain.height/coin->chain->bundlesize ) { - checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1); - if ( checki == bundlei ) + for (bundlei=0; bundlein; bundlei++) { - if ( (fp= fopen(fname,"rb")) != 0 ) - fclose(fp); - else break; + checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1); + if ( checki == bundlei ) + { + if ( (fp= fopen(fname,"rb")) != 0 ) + fclose(fp); + else break; + } } - } - if ( bp == coin->current && (bp->ramchain.H.data == 0 || bp->ramchain.H.data->numblocks != bundlei) ) - { - if ( iguana_bundlesaveHT(coin,mem,memB,bp,(uint32_t)time(NULL)) == 0 ) + if ( bp == coin->current && (bp->ramchain.H.data == 0 || bp->ramchain.H.data->numblocks != bundlei) ) { - + printf("RT bundls\n"); + if ( iguana_bundlesaveHT(coin,mem,memB,bp,(uint32_t)time(NULL)) == 0 ) + { + + } } } }