diff --git a/iguana/iguana777.c b/iguana/iguana777.c index b45290593..d840fec73 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -471,6 +471,12 @@ void iguana_helper(void *arg) if ( coin->polltimeout < polltimeout ) polltimeout = coin->polltimeout; //printf("call spendvectors.%d\n",bp->hdrsi); + if ( coin->PREFETCHLAG > 0 ) + { + iguana_ramchain_prefetch(coin,&bp->ramchain,0); + if ( bp->hdrsi > 0 ) + iguana_prefetch(coin,bp,bp->hdrsi-1,1); + } if ( (retval= iguana_spendvectors(coin,bp,&bp->ramchain,0,bp->n,0)) >= 0 ) { flag++; diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 4a1f2228b..d5e48a703 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -851,6 +851,7 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle int32_t iguana_blocksmissing(struct iguana_info *coin,int32_t *nonzp,uint8_t missings[IGUANA_MAXBUNDLESIZE/8+1],bits256 hashes[],double mult,struct iguana_bundle *bp,int32_t capacity); FILE *myfopen(char *fname,char *mode); int32_t myfclose(FILE *fp); +void iguana_prefetch(struct iguana_info *coin,struct iguana_bundle *bp,int32_t width,int32_t flags); extern int32_t HDRnet,netBLOCKS; diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 2c0a6820e..95673a200 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -328,7 +328,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl else { char str[65]; - if ( bits256_nonz(block->RO.prev_block) != 0 ) + if ( 0 && bits256_nonz(block->RO.prev_block) != 0 ) printf("chainlink error: cant find prev.(%s)\n",bits256_str(str,block->RO.prev_block)); iguana_blockunmark(coin,block,0,-1,0); //memset(&block->RO.prev_block.bytes,0,sizeof(block->RO.prev_block)); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index c69f532ac..b3b36f528 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -817,12 +817,6 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st if ( strcmp(coin->symbol,"BTC") == 0 ) printf("start UTXOGEN.%d max.%d ptr.%p millis.%.3f\n",bp->bundleheight,n,ptr,startmillis); //txidind = spendind = rdata->firsti; - if ( coin->PREFETCHLAG > 0 ) - { - iguana_ramchain_prefetch(coin,ramchain,0); - if ( bp->hdrsi > 0 ) - iguana_prefetch(coin,bp,bp->hdrsi-1,1); - } starttime = (uint32_t)time(NULL); txidind = B[starti].firsttxidind; spendind = B[starti].firstvin; @@ -862,7 +856,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st } if ( coin->PREFETCHLAG > 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG ) { - //printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch); + printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch); iguana_ramchain_prefetch(coin,&spentbp->ramchain,2); spentbp->lastprefetch = now; } @@ -1611,7 +1605,7 @@ int32_t iguana_spendvectorconvs(struct iguana_info *coin,struct iguana_bundle *s spent_hdrsi = spentbp->hdrsi; ramchain = (spentbp == coin->current) ? &coin->RTramchain : &spentbp->ramchain; numpkinds = ramchain->H.data->numpkinds; - iguana_ramchain_prefetch(coin,&spentbp->ramchain,0); + iguana_ramchain_prefetch(coin,ramchain,0); spentU = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Uoffset); for (i=converted=0; i