Browse Source

revert utxofinish

dPoW2
jl777 8 years ago
parent
commit
1762bd5d25
  1. 2
      iguana/iguana_bundles.c
  2. 4
      iguana/iguana_ramchain.c
  3. 4
      iguana/iguana_recv.c
  4. 10
      iguana/iguana_spendvectors.c

2
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 ) if ( coin->blockdepth == 0 && coin->blockdepth == 0 && bp->hdrsi == coin->bundlescount-1 )
iguana_autoextend(myinfo,coin,bp); iguana_autoextend(myinfo,coin,bp);
if ( 0 && bp->hdrsi == 0 ) 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->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); 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);
bp->nexttime = (uint32_t)time(NULL) + ((bp->hdrsi > starti) ? 0 : -2); 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) ) if ( bp->hdrsi == coin->bundlescount-1 || (bp->numhashes < bp->n && bp->bundleheight < coin->longestchain-coin->chain->bundlesize) )
iguana_bundlehdr(myinfo,coin,bp,starti); iguana_bundlehdr(myinfo,coin,bp,starti);

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/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/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); sprintf(fname,"%s/%s/validated/%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight), OS_removefile(fname,0);
bp->startutxo = bp->balancefinish = bp->validated = bp->emitfinish = bp->converted = 0; bp->utxofinish = bp->startutxo = bp->balancefinish = bp->validated = bp->emitfinish = bp->converted = 0;
//iguana_ramchain_free(coin,&bp->ramchain,1); //iguana_ramchain_free(coin,&bp->ramchain,1);
return(0); return(0);
} }
@ -1334,7 +1334,7 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha
{ {
ramchain->Xspendptr = ptr; ramchain->Xspendptr = ptr;
ramchain->numXspends = (int32_t)((filesize - sizeof(sha256)) / sizeof(*ramchain->Xspendinds)); ramchain->numXspends = (int32_t)((filesize - sizeof(sha256)) / sizeof(*ramchain->Xspendinds));
bp->startutxo = bp->emitfinish = (uint32_t)time(NULL); bp->startutxo = bp->utxofinish = (uint32_t)time(NULL);
if ( bp->Xvalid == 0 ) if ( bp->Xvalid == 0 )
{ {
if ( (rand() % 10) == 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; numtx = origtxdata->zblock.RO.txn_count;
for (i=0; i<coin->bundlescount; i++) for (i=0; i<coin->bundlescount; i++)
if ( (bp= coin->bundles[i]) != 0 && bp->emitfinish <= 1 ) if ( (bp= coin->bundles[i]) != 0 && bp->utxofinish <= 1 )
break; break;
if ( (i > coin->bundlescount-2 && coin->blocks.hwmchain.height > coin->longestchain-coin->chain->bundlesize*2) || coin->RTheight > 0 ) 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 ) if ( coin->almostRT == 0 )
{ {
for (i=0; i<coin->bundlescount; i++) for (i=0; i<coin->bundlescount; i++)
if ( (bp= coin->bundles[i]) != 0 && bp->emitfinish <= 1 ) if ( (bp= coin->bundles[i]) != 0 && bp->utxofinish <= 1 )
break; break;
if ( (i > coin->bundlescount-2 && coin->blocks.hwmchain.height > coin->longestchain-coin->chain->bundlesize*2) || coin->RTheight > 0 ) if ( (i > coin->bundlescount-2 && coin->blocks.hwmchain.height > coin->longestchain-coin->chain->bundlesize*2) || coin->RTheight > 0 )
coin->almostRT = 1; coin->almostRT = 1;

10
iguana/iguana_spendvectors.c

@ -622,7 +622,7 @@ int32_t iguana_volatilesinit(struct supernet_info *myinfo,struct iguana_info *co
{ {
if ( (bp= coin->bundles[i]) == 0 ) if ( (bp= coin->bundles[i]) == 0 )
continue; continue;
if ( bp->emitfinish <= 1 || (i > 0 && bp->emitfinish <= 1) ) if ( bp->emitfinish <= 1 || (i > 0 && bp->utxofinish <= 1) )
{ {
//printf("hdrsi.[%d] emitfinish.%u utxofinish.%u\n",i,bp->emitfinish,bp->utxofinish); //printf("hdrsi.[%d] emitfinish.%u utxofinish.%u\n",i,bp->emitfinish,bp->utxofinish);
continue; 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 ) 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->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);
break; break;
} }
if ( i == 0 ) if ( i == 0 )
bp->emitfinish = bp->startutxo = (uint32_t)time(NULL); bp->utxofinish = bp->startutxo = (uint32_t)time(NULL);
} }
if ( i < coin->bundlescount-1 ) 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++) for (i=0; i<coin->bundlescount-1; i++)
{ {
if ( (bp= coin->bundles[i]) != 0 ) if ( (bp= coin->bundles[i]) != 0 )
bp->startutxo = bp->emitfinish = bp->converted = bp->balancefinish = bp->validated = 0; bp->utxofinish = bp->startutxo = bp->emitfinish = bp->converted = bp->balancefinish = bp->validated = 0;
} }
} }
else else
@ -1160,7 +1160,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); 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 ) if ( errs == 0 )
bp->validated = (uint32_t)time(NULL); bp->validated = (uint32_t)time(NULL);
else bp->startutxo = bp->emitfinish = 0; else bp->startutxo = bp->utxofinish = 0;
//iguana_volatilesmap(coin,&bp->ramchain); //iguana_volatilesmap(coin,&bp->ramchain);
//if ( bp == coin->current ) //if ( bp == coin->current )
// coin->RTdatabad = -1; // coin->RTdatabad = -1;

Loading…
Cancel
Save