Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
12978b2990
  1. 2
      iguana/iguana777.c
  2. 6
      iguana/iguana_bundles.c
  3. 12
      iguana/iguana_unspents.c

2
iguana/iguana777.c

@ -451,7 +451,7 @@ void iguana_helper(void *arg)
{
//printf("skip.[%d] nexttime.%u lag.%ld coin->active.%d\n",bp->hdrsi,bp->nexttime,time(NULL)-bp->nexttime,coin->active);
allcurrent--;
iguana_bundleQ(ptr->coin,bp,1000);
iguana_bundleQ(coin,bp,1000);
}
}
else //if ( coin->active != 0 )

6
iguana/iguana_bundles.c

@ -867,15 +867,15 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
{
if ( iguana_bundlefinalize(coin,bp,mem,memB) == 0 )
return(0);
else bp->nexttime--;
//else bp->nexttime--;
retval = 1;
}
else if ( bp->hdrsi == starti || (bp->hdrsi >= starti && bp->hdrsi <= starti+range) ) //bits256_nonz(bp->allhash) != 0 &&
{
max = bp->n;
counter = 0;//iguana_bundleissue(coin,bp,max,timelimit);
if ( bp == coin->current && coin->isRT == 0 )
bp->nexttime--;
//if ( bp == coin->current && coin->isRT == 0 )
// bp->nexttime--;
if ( bp->isRT == 0 && bp == coin->current && counter > 0 )
printf("ITER.rt%d now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->isRT,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
if ( bp->hdrsi == starti && bp->isRT == 0 )

12
iguana/iguana_unspents.c

@ -418,7 +418,7 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st
return(0);
}
struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *prevhashp,uint32_t *unspentindp,struct iguana_ramchain *ramchain,int32_t spent_hdrsi,struct iguana_spend *s)
struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *prevhashp,uint32_t *unspentindp,struct iguana_ramchain *ramchain,int32_t spent_hdrsi,struct iguana_spend *s,int32_t txonly)
{
int32_t prev_vout,height,hdrsi; uint32_t sequenceid,unspentind,now; char str[65];
struct iguana_bundle *spentbp=0; struct iguana_txid *T,TX,*tp; bits256 *X; bits256 prev_hash;
@ -460,13 +460,13 @@ struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *pre
{
if ( spentbp->lastprefetch == 0 || now >= spentbp->lastprefetch+5*coin->PREFETCHLAG )
{
iguana_ramchain_prefetch(coin,&spentbp->ramchain,1);
iguana_ramchain_prefetch(coin,&spentbp->ramchain,txonly);
spentbp->lastprefetch = now;
}
else if ( duration > 1 && duration > (10 * coin->txidfind_totalmillis)/coin->txidfind_num && (rand() % (IGUANA_NUMHELPERS>>1)) == 0 )//&& now >= spentbp->lastprefetch+coin->PREFETCHLAG )
{
//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,1);
iguana_ramchain_prefetch(coin,&spentbp->ramchain,txonly);
spentbp->lastprefetch = now;
}
}
@ -832,7 +832,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp)
s = &S[spendind];
if ( s->external != 0 && s->prevout >= 0 )
{
if ( (spentbp= iguana_externalspent(coin,&prevhash,&spent_unspentind,ramchain,bp->hdrsi,s)) != 0 && spentbp->ramchain.H.data != 0 )
if ( (spentbp= iguana_externalspent(coin,&prevhash,&spent_unspentind,ramchain,bp->hdrsi,s,1)) != 0 && spentbp->ramchain.H.data != 0 )
{
if ( spentbp == bp )
{
@ -1080,7 +1080,7 @@ int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct i
if ( s->external != 0 && s->prevout >= 0 )
{
double startmillis = OS_milliseconds(); static double totalmillis; static int32_t num;
if ( (spentbp= iguana_externalspent(coin,&prevhash,&spent_unspentind,RTramchain,bp->hdrsi,s)) == 0 || spent_unspentind == 0 || spent_unspentind >= spentbp->ramchain.H.data->numunspents || spentbp->hdrsi < 0 || spentbp->hdrsi >= bp->hdrsi || spentbp == bp )
if ( (spentbp= iguana_externalspent(coin,&prevhash,&spent_unspentind,RTramchain,bp->hdrsi,s,0)) == 0 || spent_unspentind == 0 || spent_unspentind >= spentbp->ramchain.H.data->numunspents || spentbp->hdrsi < 0 || spentbp->hdrsi >= bp->hdrsi || spentbp == bp )
{
char str[65];
printf("RTutxo: unexpected spendbp: height.%d bp.[%d] U%d <- S%d.[%d] [ext.%d %s prev.%d]\n",height,spentbp!=0?spentbp->hdrsi:-1,spent_unspentind,spendind,bp->hdrsi,s->external,bits256_str(str,prevhash),s->prevout);
@ -1090,7 +1090,7 @@ int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct i
if ( (++num % 100000) == 0 )
printf("externalspents.[%d] ave %.2f micros, total %.2f seconds\n",num,(totalmillis*1000.)/num,totalmillis/1000.);
rdata = spentbp->ramchain.H.data;
if ( 1 && coin->PREFETCHLAG != 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG )
if ( 0 && coin->PREFETCHLAG != 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG )
{
printf("RT prefetch[%d] from.[%d] lag.%d bundlei.%d numspends.%d of %d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch,bundlei,spendind,RTramchain->H.spendind);
iguana_ramchain_prefetch(coin,&spentbp->ramchain,0);

Loading…
Cancel
Save