From 39ebe72822e9883dcdbdf99948f73e7f8b45a972 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Apr 2016 15:15:37 -0600 Subject: [PATCH] test --- iguana/iguana_unspents.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 61c26cf83..e903b4678 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -651,7 +651,7 @@ void iguana_prefetch(struct iguana_info *coin,struct iguana_bundle *bp) int32_t i; struct iguana_bundle *spentbp; uint32_t starttime = (uint32_t)time(NULL); if ( bp->hdrsi > 4 ) { - printf("start prefetch4 for [%d]\n",bp->hdrsi); + //printf("start prefetch4 for [%d]\n",bp->hdrsi); for (i=1; i<4; i++) { if ( (spentbp= coin->bundles[bp->hdrsi - i]) != 0 ) @@ -660,7 +660,7 @@ void iguana_prefetch(struct iguana_info *coin,struct iguana_bundle *bp) spentbp->lastprefetch = starttime; } } - printf("end prefetch4 for [%d] elapsed %d\n",bp->hdrsi,(uint32_t)time(NULL)-starttime); + //printf("end prefetch4 for [%d] elapsed %d\n",bp->hdrsi,(uint32_t)time(NULL)-starttime); } } @@ -688,8 +688,11 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp) total += n; printf("start UTXOGEN.%d max.%d ptr.%p\n",bp->bundleheight,n,ptr); txidind = spendind = rdata->firsti; - iguana_ramchain_prefetch(coin,ramchain); - iguana_prefetch(coin,bp); + if ( coin->PREFETCHLAG != 0 ) + { + iguana_ramchain_prefetch(coin,ramchain); + iguana_prefetch(coin,bp); + } starttime = (uint32_t)time(NULL); for (i=0; in; i++) { @@ -823,7 +826,8 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp,int3 printf("iguana_balancegen.%d: no Xspendinds[%d]\n",bp->hdrsi,ramchain->numXspends); return(-1); } - iguana_ramchain_prefetch(coin,ramchain); + if ( coin->PREFETCHLAG != 0 ) + iguana_ramchain_prefetch(coin,ramchain); //printf("BALANCEGEN.%d hdrs.%d\n",bp->bundleheight,bp->hdrsi); txidind = spendind = rdata->firsti; for (i=0; in; i++) @@ -1233,7 +1237,8 @@ void iguana_RTramchainalloc(struct iguana_info *coin,struct iguana_bundle *bp) dest->H.txidind = dest->H.unspentind = dest->H.spendind = dest->pkind = dest->H.data->firsti; dest->externalind = dest->H.stacksize = 0; dest->H.scriptoffset = 1; - iguana_prefetch(coin,bp); + if ( coin->PREFETCHLAG != 0 ) + iguana_prefetch(coin,bp); } }