From a1a230c6980ef2c2848fc2134eeb83c10cab031a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Sep 2016 14:01:49 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 8 ++++++-- iguana/iguana_bundles.c | 6 ++++-- iguana/iguana_recv.c | 2 +- iguana/iguana_spendvectors.c | 8 ++++---- includes/iguana_defines.h | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 5ad66747b..2f42d7e93 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -326,12 +326,16 @@ int32_t iguana_emitfinished(struct supernet_info *myinfo,struct iguana_info *coi { if ( (bp= coin->bundles[i]) != 0 ) { + if ( bp->emitfinish == 0 && bp->ramchain.H.data != 0 ) + bp->emitfinish = (uint32_t)time(NULL); if ( bp->emitfinish > 1 ) n++; + //printf("%u ",bp->emitfinish); //else if ( bp->emitfinish == 0 && bp->queued == 0 ) // iguana_bundleQ(myinfo,coin,bp,1000); } } + //printf("emitfinished.%d\n",n); return(n); } @@ -726,9 +730,9 @@ void iguana_helper(void *arg) } } } + if ( helperid == 0 ) + iguana_coin_mainiter(myinfo,coin,&numpeers,&MEM,MEMB); } - if ( helperid == 0 ) - iguana_coin_mainiter(myinfo,coin,&numpeers,&MEM,MEMB); } //portable_mutex_unlock(&myinfo->allcoins_mutex); n = queue_size(&bundlesQ); diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 8b5b03341..929c3eadc 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1364,12 +1364,14 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch numcached += bp->numcached; numrecv += bp->numrecv; numsaved += bp->numsaved; - if ( bp->emitfinish > 1 ) + if ( bp->utxofinish > 1 ) numutxo++; if ( bp->balancefinish > 1 ) numbalances++; if ( bp->validated > 1 ) numv++; + if ( bp->emitfinish == 0 && bp->ramchain.H.data != 0 ) + bp->emitfinish = (uint32_t)time(NULL); if ( bp->emitfinish >= 1 ) { if ( bp->emitfinish == 1 ) @@ -1517,7 +1519,7 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch { //printf("bundleQ.[%d]\n",j); bp->balancefinish = bp->startutxo = 0; - bp->emitfinish = 1; + bp->utxofinish = 1; iguana_bundleQ(myinfo,coin,bp,1000); } } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index c0603add4..3fc081107 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -2039,7 +2039,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle //getchar(); return(-1); } - if ( 1 && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 && block != 0 && block->txvalid != 0 ) + if ( 0 && coin->enableCACHE != 0 && iguana_speculativesearch(coin,&block,hash2) != 0 && block != 0 && block->txvalid != 0 ) { //printf("found valid [%d:%d] in blockQ\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1); return(0); diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index 67ee17029..032aa5c24 100755 --- a/iguana/iguana_spendvectors.c +++ b/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->emitfinish = (uint32_t)time(NULL); + bp->utxofinish = (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->utxofinish <= 1 || (i > 0 && bp->utxofinish <= 1) ) { //printf("hdrsi.[%d] emitfinish.%u utxofinish.%u\n",i,bp->emitfinish,bp->utxofinish); continue; @@ -751,7 +751,7 @@ void iguana_initfinal(struct supernet_info *myinfo,struct iguana_info *coin,bits } for (i=0; ibundlescount-1; i++) { - if ( (bp= coin->bundles[i]) == 0 || bp->emitfinish <= 1 ) + if ( (bp= coin->bundles[i]) == 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->utxofinish:-1); break; @@ -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); if ( errs == 0 ) bp->validated = (uint32_t)time(NULL); - else bp->startutxo = bp->utxofinish = 0; + else bp->validated = bp->startutxo = bp->utxofinish = 0; //iguana_volatilesmap(coin,&bp->ramchain); //if ( bp == coin->current ) // coin->RTdatabad = -1; diff --git a/includes/iguana_defines.h b/includes/iguana_defines.h index b4ed25cce..30fcc841f 100755 --- a/includes/iguana_defines.h +++ b/includes/iguana_defines.h @@ -25,7 +25,7 @@ #ifdef __PNACL__ #define IGUANA_MAXITERATIONS 77 #else -#define IGUANA_MAXITERATIONS 77 +#define IGUANA_MAXITERATIONS 777 #endif #define IGUANA_DEFAULTLAG 7