From 1fa8b0ea74ba9c09658a91d01f0ae681f4351261 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 14 Mar 2016 22:27:21 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 14 +++++++++++--- iguana/iguana777.h | 4 ++-- iguana/iguana_recv.c | 9 +++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 4166ddc39..053f98a64 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -305,7 +305,15 @@ int32_t iguana_helpertask(FILE *fp,struct OS_memspace *mem,struct OS_memspace *m } else if ( ptr->type == 'B' ) { - iguana_bundleiters(coin,bp,ptr->timelimit); + 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; + } } else if ( ptr->type == 'E' ) { @@ -378,8 +386,8 @@ void iguana_helper(void *arg) } } if ( flag == 0 ) - usleep(100000); - else usleep(5000); + usleep(500000); + else usleep(50000); } } diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 67c159f83..7c8410c92 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -37,9 +37,9 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_HEADPERCENTAGE 0. #define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_MAXPENDHDRS 1 -#define _IGUANA_MAXPENDING 32 +#define _IGUANA_MAXPENDING 3 #define IGUANA_MINPENDBUNDLES 16 -#define IGUANA_MAXPENDBUNDLES 150 +#define IGUANA_MAXPENDBUNDLES 64 #define IGUANA_BUNDLELOOP 10000 #define IGUANA_RPCPORT 7778 #define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 5359be1e1..e42f1ce62 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -533,6 +533,11 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int iguana_bundleQ(coin,bp,1000); return(0); } + else if ( bp->emitfinish != 0 ) + { + iguana_bundleQ(coin,bp,1000); + return(0); + } //printf("BUNDLEITERS.%d\n",bp->hdrsi); if ( bp->hdrsi <= lasti && coin->lastpending != 0 ) { @@ -622,9 +627,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(1); + return('E'); } } iguana_bundleQ(coin,bp,width);