From 37f503ac93d810f815a2086a2c8970b6c837ab61 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Apr 2016 15:18:57 -0500 Subject: [PATCH] test --- iguana/iguana_ramchain.c | 6 +++--- iguana/iguana_unspents.c | 4 ++-- iguana/main.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 400467f3b..a364ed5c8 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1018,8 +1018,8 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits } }*/ #ifdef __PNACL__ - //static portable_mutex_t mutex; - //portable_mutex_lock(&mutex); + static portable_mutex_t mutex; + portable_mutex_lock(&mutex); #endif if ( (fp= fopen(fname,"wb")) == 0 ) printf("iguana_ramchain_save: couldnt create.(%s) errno.%d\n",fname,errno); @@ -1042,7 +1042,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits fclose(fp); } #ifdef __PNACL__ - //portable_mutex_unlock(&mutex); + portable_mutex_unlock(&mutex); #endif return(fpos); } diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 104163bb2..f1865b8b0 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -625,10 +625,10 @@ struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *pre iguana_ramchain_prefetch(coin,&spentbp->ramchain,prefetchflag); spentbp->lastprefetch = now; } - else if ( (duration > 100 || duration > (100 * coin->txidfind_totalmillis)/coin->txidfind_num) && now >= spentbp->lastprefetch+coin->PREFETCHLAG )//(rand() % (IGUANA_NUMHELPERS>>1)) == 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG ) + else if ( (rand() % IGUANA_NUMHELPERS) == 0 && (duration > 100 || duration > (100 * coin->txidfind_totalmillis)/coin->txidfind_num) && now >= spentbp->lastprefetch+coin->PREFETCHLAG )//(rand() % (IGUANA_NUMHELPERS>>1)) == 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG ) //if ( duration > 10 && spentbp->lastprefetch == 0 ) { - printf("slow txidfind %.2f vs %.2f prefetch[%d] from.[%d] lag.%ld last.%u\n",duration,coin->txidfind_totalmillis/coin->txidfind_num,spentbp->hdrsi,ramchain->H.data->height/coin->chain->bundlesize,time(NULL) - spentbp->lastprefetch,spentbp->lastprefetch); + //printf("slow txidfind %.2f vs %.2f prefetch[%d] from.[%d] lag.%ld last.%u\n",duration,coin->txidfind_totalmillis/coin->txidfind_num,spentbp->hdrsi,ramchain->H.data->height/coin->chain->bundlesize,time(NULL) - spentbp->lastprefetch,spentbp->lastprefetch); iguana_ramchain_prefetch(coin,&spentbp->ramchain,prefetchflag); spentbp->lastprefetch = now; } diff --git a/iguana/main.c b/iguana/main.c index b69798a9d..718265ba3 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -73,7 +73,7 @@ char GLOBAL_DBDIR[512] = "/DB"; char GLOBAL_HELPDIR[512] = "/DB/help"; char GLOBAL_VALIDATEDIR[512] = "/DB/purgeable"; char GLOBAL_CONFSDIR[512] = "/DB/confs"; -int32_t IGUANA_NUMHELPERS = 4; +int32_t IGUANA_NUMHELPERS = 1; #else char GLOBAL_TMPDIR[512] = "tmp"; char GLOBAL_HELPDIR[512] = "help";