Browse Source

test

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

8
iguana/iguana_bundles.c

@ -735,7 +735,7 @@ int32_t iguana_bundleready(struct iguana_info *coin,struct iguana_bundle *bp,int
}
else
{
//#ifndef __PNACL__
#ifndef __PNACL__
int32_t checki,hdrsi; FILE *fp;
fname[0] = 0;
checki = iguana_peerfname(coin,&hdrsi,GLOBAL_TMPDIR,fname,0,block->RO.hash2,zero,1,0);
@ -750,7 +750,7 @@ int32_t iguana_bundleready(struct iguana_info *coin,struct iguana_bundle *bp,int
fclose(fp);
}
else
//#endif
#endif
iguana_blockunmark(coin,block,bp,i,1);
}
}
@ -959,8 +959,8 @@ int32_t iguana_bundlefinalize(struct iguana_info *coin,struct iguana_bundle *bp,
}
else
{
printf("bundlefinalize.[%d] not ready\n",bp->hdrsi);
iguana_bundleremove(coin,bp->hdrsi,1);
//printf("bundlefinalize.[%d] not ready\n",bp->hdrsi);
//iguana_bundleremove(coin,bp->hdrsi,1);
}
return(0);
}

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 > 10 || duration > (10 * coin->txidfind_totalmillis)/coin->txidfind_num) && (rand() % (IGUANA_NUMHELPERS>>1)) == 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG )
else if ( (duration > 10 || duration > (10 * 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 = 1;
int32_t IGUANA_NUMHELPERS = 4;
#else
char GLOBAL_TMPDIR[512] = "tmp";
char GLOBAL_HELPDIR[512] = "help";

Loading…
Cancel
Save