From af8af1fadecccabd3149b6b792a2ce6d11d29fe7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 14 Mar 2016 22:40:49 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 24 +++++++----------------- iguana/iguana777.h | 2 +- iguana/iguana_bundles.c | 5 ++--- iguana/iguana_recv.c | 4 ++-- iguana/main.c | 3 ++- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 72f7116c2..60a4cc3e4 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -238,8 +238,8 @@ void iguana_emitQ(struct iguana_info *coin,struct iguana_bundle *bp) ptr->bp = bp, ptr->hdrsi = bp->hdrsi; ptr->type = 'E'; ptr->starttime = (uint32_t)time(NULL); - //printf("%s EMIT.%d[%d] emitfinish.%u\n",coin->symbol,ptr->hdrsi,bp->n,bp->emitfinish); - queue_enqueue("helperQ",&helperQ,&ptr->DL,0); + printf("%s EMIT.%d[%d] emitfinish.%u\n",coin->symbol,ptr->hdrsi,bp->n,bp->emitfinish); + queue_enqueue("emitQ",&emitQ,&ptr->DL,0); } void iguana_mergeQ(struct iguana_info *coin,struct iguana_bundle *bp,struct iguana_bundle *nextbp) @@ -305,15 +305,7 @@ int32_t iguana_helpertask(FILE *fp,struct OS_memspace *mem,struct OS_memspace *m } else if ( ptr->type == 'B' ) { - if ( iguana_bundleiters(coin,bp,ptr->timelimit) == 'E' ) - { - if ( iguana_bundlesaveHT(coin,mem,memB,bp,ptr->starttime) == 0 ) - { - //fprintf(stderr,"emitQ coin.%p bp.[%d]\n",ptr->coin,bp->bundleheight); - bp->emitfinish = (uint32_t)time(NULL) + 1; - coin->numemitted++; - } else bp->emitfinish = 0; - } + iguana_bundleiters(coin,bp,ptr->timelimit); } else if ( ptr->type == 'E' ) { @@ -351,19 +343,17 @@ void iguana_helper(void *arg) { //iguana_jsonQ(); flag = 0; - if ( (ptr= queue_dequeue(&helperQ,0)) != 0 ) + if ( (ptr= queue_dequeue(&emitQ,0)) != 0 || (ptr= queue_dequeue(&helperQ,0)) != 0 ) { - if ( (coin= ptr->coin) != 0 && 0 ) - queue_enqueue("reQ",&helperQ,&ptr->DL,0); - else + if ( ptr->bp != 0 && (coin= ptr->coin) != 0 ) { idle = 0; coin->helperdepth++; iguana_helpertask(fp,&MEM,MEMB,ptr); coin->helperdepth--; - myfree(ptr,ptr->allocsize); + flag++; } - flag++; + myfree(ptr,ptr->allocsize); } else if ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 ) { diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 7c8410c92..8801fd55d 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -793,7 +793,7 @@ int32_t iguana_bloomfind(struct iguana_info *coin,struct iguana_bloom16 *bloom,i struct iguana_bloominds iguana_bloomset(struct iguana_info *coin,struct iguana_bloom16 *bloom,int32_t incr,struct iguana_bloominds bit); int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_bundle *bp); -extern queue_t bundlesQ,validateQ; +extern queue_t bundlesQ,validateQ,emitQ; extern char GLOBALTMPDIR[]; #include "../includes/iguana_api.h" diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 30e7e90a8..80026b2ce 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -467,11 +467,10 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) if ( bp->emitfinish > coin->startutc ) { done++; - if ( bp->emitfinish > 1 ) - numemit++; + numemit++; iguana_bundlepurge(coin,bp); } - else + else if ( bp->emitfinish == 0 ) { if ( firstgap == 0 ) firstgap = lastpending = bp; diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 063d4ea00..bf2812144 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -629,9 +629,9 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int coin->MAXBUNDLES++; } sleep(1); - //iguana_emitQ(coin,bp); + iguana_emitQ(coin,bp); iguana_bundleQ(coin,bp,width); - return('E'); + return(1); } } iguana_bundleQ(coin,bp,width); diff --git a/iguana/main.c b/iguana/main.c index c95ea3a31..c2e898e45 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -38,7 +38,7 @@ struct iguana_info *Coins[IGUANA_MAXCOINS]; char Userhome[512],GLOBALTMPDIR[512] = "tmp"; int32_t USE_JAY,FIRST_EXTERNAL,IGUANA_disableNXT,Debuglevel; uint32_t prices777_NXTBLOCK,MAX_DEPTH = 100; -queue_t helperQ,jsonQ,finishedQ,bundlesQ,validateQ; +queue_t helperQ,jsonQ,finishedQ,bundlesQ,validateQ,emitQ; struct supernet_info MYINFO,**MYINFOS; static int32_t initflag; cJSON *API_json; @@ -1085,6 +1085,7 @@ void iguana_main(void *arg) iguana_initQ(&helperQ,"helperQ"); iguana_initQ(&jsonQ,"jsonQ"); + iguana_initQ(&emitQ,"emitQ"); iguana_initQ(&finishedQ,"finishedQ"); iguana_initQ(&bundlesQ,"bundlesQ"); iguana_initQ(&validateQ,"validateQ");