Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
af8af1fade
  1. 24
      iguana/iguana777.c
  2. 2
      iguana/iguana777.h
  3. 5
      iguana/iguana_bundles.c
  4. 4
      iguana/iguana_recv.c
  5. 3
      iguana/main.c

24
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 )
{

2
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"

5
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;

4
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);

3
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");

Loading…
Cancel
Save