Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
08c97266cb
  1. 2
      iguana/iguana777.h
  2. 8
      iguana/iguana_bundles.c

2
iguana/iguana777.h

@ -42,7 +42,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_HEADPERCENTAGE 0. #define IGUANA_HEADPERCENTAGE 0.
#define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDHDRS 1
#define IGUANA_MAXPENDINGREQUESTS 32 #define IGUANA_MAXPENDINGREQUESTS 128
#define IGUANA_PENDINGREQUESTS 512 #define IGUANA_PENDINGREQUESTS 512
#define IGUANA_MINPENDBUNDLES 2 #define IGUANA_MINPENDBUNDLES 2
#define IGUANA_MAXPENDBUNDLES 64 #define IGUANA_MAXPENDBUNDLES 64

8
iguana/iguana_bundles.c

@ -610,7 +610,7 @@ int32_t iguana_setmaxbundles(struct iguana_info *coin)
double completed; double completed;
if ( coin->current != 0 && coin->bundlescount != 0 ) if ( coin->current != 0 && coin->bundlescount != 0 )
{ {
completed = cbrt(((double)coin->current->hdrsi + 1) / coin->bundlescount); completed = sqrt(((double)coin->current->hdrsi + 1) / coin->bundlescount);
coin->MAXBUNDLES = (double)(coin->endPEND - coin->startPEND)*completed + coin->startPEND; coin->MAXBUNDLES = (double)(coin->endPEND - coin->startPEND)*completed + coin->startPEND;
//printf("MAXBUNDLES %d (%d -> %d) completed %.3f\n",coin->MAXBUNDLES,coin->startPEND,coin->endPEND,completed); //printf("MAXBUNDLES %d (%d -> %d) completed %.3f\n",coin->MAXBUNDLES,coin->startPEND,coin->endPEND,completed);
} }
@ -791,9 +791,9 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
if ( coin->stucktime != 0 ) if ( coin->stucktime != 0 )
{ {
lag = (int32_t)time(NULL)-coin->stucktime; lag = (int32_t)time(NULL)-coin->stucktime;
if ( ((lag/coin->MAXSTUCKTIME)>>1) > coin->stuckiters ) if ( (lag/coin->MAXSTUCKTIME) > coin->stuckiters )
{ {
coin->stuckiters = (int32_t)lag/60; coin->stuckiters = (int32_t)(lag/coin->MAXSTUCKTIME);
if ( 0 && lag > coin->MAXSTUCKTIME ) if ( 0 && lag > coin->MAXSTUCKTIME )
{ {
while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 ) while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 )
@ -890,7 +890,7 @@ int32_t iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,
if ( bp->numissued < bp->n ) if ( bp->numissued < bp->n )
max = bp->numissued; max = bp->numissued;
else max = bp->origmissings; else max = bp->origmissings;
if ( bp->missingstime == 0 || bp->numissued < bp->n || (bp == coin->current && time(NULL) > bp->missingstime+lag) ) // if ( bp->missingstime == 0 || bp->numissued < bp->n )//|| (bp == coin->current && time(NULL) > bp->missingstime+lag) ) //
{ {
if ( (n= iguana_bundlerequests(coin,missings,&bp->origmissings,&tmp,bp,lag)) > 0 ) if ( (n= iguana_bundlerequests(coin,missings,&bp->origmissings,&tmp,bp,lag)) > 0 )
{ {

Loading…
Cancel
Save