Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
37f503ac93
  1. 6
      iguana/iguana_ramchain.c
  2. 4
      iguana/iguana_unspents.c
  3. 2
      iguana/main.c

6
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);
}

4
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;
}

2
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";

Loading…
Cancel
Save