From 1b9ca08c09478b8c912b3b5a5569edc7ffa38d5b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 27 Mar 2016 23:06:44 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 2 +- iguana/iguana_bundles.c | 28 ++++++++++++---------------- iguana/iguana_unspents.c | 2 +- iguana/main.c | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index a8582bc7e..2dee17d47 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -282,7 +282,7 @@ void iguana_bundleQ(struct iguana_info *coin,struct iguana_bundle *bp,int32_t ti ptr->starttime = (uint32_t)time(NULL); ptr->timelimit = timelimit; coin->numbundlesQ++; - printf("%s %p bundle.%d[%d] ht.%d emitfinish.%u\n",coin->symbol,bp,ptr->hdrsi,bp->n,bp->bundleheight,bp->emitfinish); + //printf("%s %p bundle.%d[%d] ht.%d emitfinish.%u\n",coin->symbol,bp,ptr->hdrsi,bp->n,bp->bundleheight,bp->emitfinish); queue_enqueue("bundlesQ",&bundlesQ,&ptr->DL,0); } diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 475338b2b..5f1fb70c6 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -875,7 +875,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru { if ( (retval= iguana_bundlefinish(coin,bp)) > 0 ) { - //printf("moved to balancesQ.%d bundleiters.%d\n",bp->hdrsi,bp->bundleheight); + printf("moved to balancesQ.%d bundleiters.%d\n",bp->hdrsi,bp->bundleheight); bp->queued = 0; return(0); } //else printf("finish incomplete.%d\n",bp->hdrsi); @@ -894,24 +894,19 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru bp->emitfinish = 1; iguana_bundletweak(coin,bp); sleep(1); // just in case data isnt totally sync'ed to HDD - if ( 0 ) - iguana_emitQ(coin,bp); + coin->emitbusy++; + if ( iguana_bundlesaveHT(coin,mem,memB,bp,(uint32_t)time(NULL)) == 0 ) + { + //fprintf(stderr,"emitQ done coin.%p bp.[%d] ht.%d\n",coin,bp->hdrsi,bp->bundleheight); + bp->emitfinish = (uint32_t)time(NULL) + 1; + coin->numemitted++; + } else { - coin->emitbusy++; - if ( iguana_bundlesaveHT(coin,mem,memB,bp,(uint32_t)time(NULL)) == 0 ) - { - //fprintf(stderr,"emitQ done coin.%p bp.[%d] ht.%d\n",coin,bp->hdrsi,bp->bundleheight); - bp->emitfinish = (uint32_t)time(NULL) + 1; - coin->numemitted++; - } - else - { - fprintf(stderr,"emitQ done coin.%p bp.[%d] ht.%d error\n",coin,bp->hdrsi,bp->bundleheight); - bp->emitfinish = 0; - } - coin->emitbusy--; + fprintf(stderr,"emitQ done coin.%p bp.[%d] ht.%d error\n",coin,bp->hdrsi,bp->bundleheight); + bp->emitfinish = 0; } + coin->emitbusy--; } retval = 1; } @@ -971,6 +966,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru } } } + printf("done hdrs.%d\n",bp->hdrsi); iguana_bundleQ(coin,bp,1000); return(retval); } diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 535e0381b..1459c3e36 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -682,7 +682,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp) } if ( now > spentbp->lastprefetch+5+5*coin->emitbusy ) { - //printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch); + printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch); iguana_ramchain_prefetch(coin,ramchain); iguana_ramchain_prefetch(coin,&spentbp->ramchain); bp->lastprefetch = spentbp->lastprefetch = now; diff --git a/iguana/main.c b/iguana/main.c index 6e832d466..a14bf9540 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -366,7 +366,7 @@ void mainloop(struct supernet_info *myinfo) bp = ptr->bp; if ( ptr->coin != coin || bp == 0 || time(NULL) < bp->nexttime ) { - if ( bp != 0 ) + if ( 0 && bp != 0 ) printf("skip.%d lag.%ld\n",bp->hdrsi,bp->nexttime-time(NULL)); queue_enqueue("balanceQ",&balancesQ,&ptr->DL,0); continue;