jl777 8 years ago
parent
commit
05dfa418be
  1. 11
      iguana/iguana777.c
  2. 6
      iguana/iguana_bundles.c
  3. 4
      iguana/iguana_ramchain.c
  4. 4
      iguana/iguana_recv.c
  5. 12
      iguana/iguana_spendvectors.c
  6. 2
      includes/iguana_structs.h

11
iguana/iguana777.c

@ -340,7 +340,7 @@ int32_t iguana_utxofinished(struct iguana_info *coin)
struct iguana_bundle *bp; int32_t i,n = 0;
for (i=0; i<coin->bundlescount-1; i++)
{
if ( (bp= coin->bundles[i]) != 0 && bp->utxofinish > 1 )
if ( (bp= coin->bundles[i]) != 0 && bp->emitfinish > 1 )
n++;
}
return(n);
@ -391,14 +391,14 @@ int32_t iguana_helperA(struct supernet_info *myinfo,struct iguana_info *coin,int
if ( iguana_bundlevalidate(myinfo,coin,bp,0) == bp->n ) //
{
retval = 0;
if ( bp->utxofinish > 1 || (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,convertflag,0)) >= 0 )
if ( bp->emitfinish > 1 || (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,convertflag,0)) >= 0 )
{
if ( retval > 0 )
{
printf("GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo);
num++;
}
bp->utxofinish = (uint32_t)time(NULL);
bp->emitfinish = (uint32_t)time(NULL);
} else printf("UTXO gen.[%d] utxo error\n",bp->hdrsi);
}
else
@ -712,12 +712,15 @@ void iguana_helper(void *arg)
{
if ( bp->startutxo == 0 && bp->numsaved >= coin->chain->bundlesize && iguana_bundleready(myinfo,coin,bp,0) == bp->n )
iguana_bundlefinalize(myinfo,coin,bp,&MEM,MEMB);
if ( bp->utxofinish != 0 && bp->validated == 0 )
if ( bp->emitfinish != 0 )
{
if ( bp->validated == 0 )
iguana_bundlevalidate(myinfo,coin,bp,1);
}
}
}
}
}
if ( helperid == 0 )
iguana_coin_mainiter(myinfo,coin,&numpeers,&MEM,MEMB);
}

6
iguana/iguana_bundles.c

@ -1117,7 +1117,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin
if ( coin->blockdepth == 0 && coin->blockdepth == 0 && bp->hdrsi == coin->bundlescount-1 )
iguana_autoextend(myinfo,coin,bp);
if ( 0 && bp->hdrsi == 0 )
printf("ITER utxo.%u now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->utxofinish,(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);
printf("ITER utxo.%u now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->emitfinish,(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);
bp->nexttime = (uint32_t)time(NULL) + ((bp->hdrsi > starti) ? 0 : -2);
if ( bp->hdrsi == coin->bundlescount-1 || (bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize) )
iguana_bundlehdr(myinfo,coin,bp,starti);
@ -1364,7 +1364,7 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
numcached += bp->numcached;
numrecv += bp->numrecv;
numsaved += bp->numsaved;
if ( bp->utxofinish > 1 )
if ( bp->emitfinish > 1 )
numutxo++;
if ( bp->balancefinish > 1 )
numbalances++;
@ -1517,7 +1517,7 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch
{
//printf("bundleQ.[%d]\n",j);
bp->balancefinish = bp->startutxo = 0;
bp->utxofinish = 1;
bp->emitfinish = 1;
iguana_bundleQ(myinfo,coin,bp,1000);
}
}

4
iguana/iguana_ramchain.c

@ -1293,7 +1293,7 @@ int32_t iguana_bundleremove(struct iguana_info *coin,int32_t hdrsi,int32_t tmpfi
sprintf(fname,"%s/%s/accounts/debits.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight), OS_removefile(fname,0);
sprintf(fname,"%s/%s/accounts/lastspends.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight), OS_removefile(fname,0);
sprintf(fname,"%s/%s/validated/%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight), OS_removefile(fname,0);
bp->utxofinish = bp->startutxo = bp->balancefinish = bp->validated = bp->emitfinish = bp->converted = 0;
bp->startutxo = bp->balancefinish = bp->validated = bp->emitfinish = bp->converted = 0;
//iguana_ramchain_free(coin,&bp->ramchain,1);
return(0);
}
@ -1334,7 +1334,7 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
{
ramchain->Xspendptr = ptr;
ramchain->numXspends = (int32_t)((filesize - sizeof(sha256)) / sizeof(*ramchain->Xspendinds));
bp->startutxo = bp->utxofinish = (uint32_t)time(NULL);
bp->startutxo = bp->emitfinish = (uint32_t)time(NULL);
if ( bp->Xvalid == 0 )
{
if ( (rand() % 10) == 0 )

4
iguana/iguana_recv.c

@ -506,7 +506,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s
{
numtx = origtxdata->zblock.RO.txn_count;
for (i=0; i<coin->bundlescount; i++)
if ( (bp= coin->bundles[i]) != 0 && bp->utxofinish <= 1 )
if ( (bp= coin->bundles[i]) != 0 && bp->emitfinish <= 1 )
break;
if ( (i > coin->bundlescount-2 && coin->blocks.hwmchain.height > coin->longestchain-coin->chain->bundlesize*2) || coin->RTheight > 0 )
{
@ -676,7 +676,7 @@ void iguana_RTgotblock(struct iguana_info *coin,bits256 hash2,uint8_t *data,int3
if ( coin->almostRT == 0 )
{
for (i=0; i<coin->bundlescount; i++)
if ( (bp= coin->bundles[i]) != 0 && bp->utxofinish <= 1 )
if ( (bp= coin->bundles[i]) != 0 && bp->emitfinish <= 1 )
break;
if ( (i > coin->bundlescount-2 && coin->blocks.hwmchain.height > coin->longestchain-coin->chain->bundlesize*2) || coin->RTheight > 0 )
coin->almostRT = 1;

12
iguana/iguana_spendvectors.c

@ -261,7 +261,7 @@ int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coi
{
bp->tmpspends = ramchain->Xspendinds;
bp->numtmpspends = ramchain->numXspends;
bp->utxofinish = (uint32_t)time(NULL);
bp->emitfinish = (uint32_t)time(NULL);
bp->balancefinish = 0;
//printf("iguana_spendvectors.[%d]: already have Xspendinds[%d]\n",bp->hdrsi,ramchain->numXspends);
return(0);
@ -622,7 +622,7 @@ int32_t iguana_volatilesinit(struct supernet_info *myinfo,struct iguana_info *co
{
if ( (bp= coin->bundles[i]) == 0 )
continue;
if ( bp->emitfinish <= 1 || (i > 0 && bp->utxofinish <= 1) )
if ( bp->emitfinish <= 1 || (i > 0 && bp->emitfinish <= 1) )
{
//printf("hdrsi.[%d] emitfinish.%u utxofinish.%u\n",i,bp->emitfinish,bp->utxofinish);
continue;
@ -753,11 +753,11 @@ void iguana_initfinal(struct supernet_info *myinfo,struct iguana_info *coin,bits
{
if ( (bp= coin->bundles[i]) == 0 || bp->emitfinish <= 1 )
{
printf("%s initfinal break.[%d]: bp.%p or emit.%u utxofinish.%u\n",coin->symbol,i,bp,bp!=0?bp->emitfinish:-1,bp!=0?bp->utxofinish:-1);
printf("%s initfinal break.[%d]: bp.%p or emit.%u utxofinish.%u\n",coin->symbol,i,bp,bp!=0?bp->emitfinish:-1,bp!=0?bp->emitfinish:-1);
break;
}
if ( i == 0 )
bp->utxofinish = bp->startutxo = (uint32_t)time(NULL);
bp->emitfinish = bp->startutxo = (uint32_t)time(NULL);
}
if ( i < coin->bundlescount-1 )
{
@ -765,7 +765,7 @@ void iguana_initfinal(struct supernet_info *myinfo,struct iguana_info *coin,bits
for (i=0; i<coin->bundlescount-1; i++)
{
if ( (bp= coin->bundles[i]) != 0 )
bp->startutxo = bp->utxofinish = bp->converted = bp->balancefinish = bp->validated = 0;
bp->startutxo = bp->emitfinish = bp->converted = bp->balancefinish = bp->validated = 0;
}
}
else
@ -1159,7 +1159,7 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c
printf("%s %s VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",coin->symbol,errs!=0?"NOT":"",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid);
if ( errs == 0 )
bp->validated = (uint32_t)time(NULL);
else bp->startutxo = bp->utxofinish = 0;
else bp->startutxo = bp->emitfinish = 0;
//iguana_volatilesmap(coin,&bp->ramchain);
//if ( bp == coin->current )
// coin->RTdatabad = -1;

2
includes/iguana_structs.h

@ -374,7 +374,7 @@ struct iguana_bundle
{
struct queueitem DL; struct iguana_info *coin; struct iguana_bundle *nextbp;
struct iguana_bloom16 bloom; int64_t totaldurations,duplicatedurations; int32_t durationscount,duplicatescount;
uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,utxofinish,balancefinish,validated,lastspeculative,dirty,nexttime,currenttime,lastprefetch,lastRT,missingstime,unsticktime,converted;
uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,balancefinish,validated,lastspeculative,dirty,nexttime,currenttime,lastprefetch,lastRT,missingstime,unsticktime,converted;
int32_t numhashes,numrecv,numsaved,numcached,generrs,currentflag,origmissings,numissued,Xvalid;
int32_t minrequests,n,hdrsi,bundleheight,numtxids,numspends,numunspents,numspec,isRT;
double avetime,threshold,metric; uint64_t datasize,estsize;

Loading…
Cancel
Save