Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
c567c2278a
  1. 1
      iguana/iguana777.h
  2. 2
      iguana/iguana_blocks.c
  3. 20
      iguana/iguana_bundles.c

1
iguana/iguana777.h

@ -823,6 +823,7 @@ int32_t iguana_mapchaininit(struct iguana_info *coin,struct iguana_ramchain *map
void iguana_autoextend(struct iguana_info *coin,struct iguana_bundle *bp);
void iguana_RTramchainfree(struct iguana_info *coin);
void iguana_coinpurge(struct iguana_info *coin);
int32_t iguana_setmaxbundles(struct iguana_info *coin);
extern int32_t HDRnet,netBLOCKS;

2
iguana/iguana_blocks.c

@ -274,7 +274,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl
if ( newblock == 0 )
return(0);
hwmchain = &coin->blocks.hwmchain;
if ( hwmchain->height > 0 && ((bp= coin->current) == 0 || hwmchain->height/coin->chain->bundlesize > bp->hdrsi) )
if ( hwmchain->height > 0 && ((bp= coin->current) == 0 || hwmchain->height/coin->chain->bundlesize >= bp->hdrsi-coin->isRT) )
return(0);
if ( (block= iguana_blockfind(coin,newblock->RO.hash2)) != 0 )
{

20
iguana/iguana_bundles.c

@ -663,19 +663,26 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
return(counter);
}
int32_t iguana_bundletweak(struct iguana_info *coin,struct iguana_bundle *bp)
int32_t iguana_setmaxbundles(struct iguana_info *coin)
{
struct iguana_bundle *lastbp; double completed;
if ( coin->current == bp )
coin->current = coin->bundles[bp->hdrsi+1];
if ( (lastbp= coin->lastpending) != 0 && lastbp->hdrsi < coin->bundlescount-1 )
coin->lastpending = coin->bundles[lastbp->hdrsi + 1];
double completed;
if ( coin->current != 0 && coin->bundlescount != 0 )
{
completed = ((double)coin->current->hdrsi + 1) / coin->bundlescount;
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);
}
return(coin->MAXBUNDLES);
}
int32_t iguana_bundletweak(struct iguana_info *coin,struct iguana_bundle *bp)
{
struct iguana_bundle *lastbp;
if ( coin->current == bp )
coin->current = coin->bundles[bp->hdrsi+1];
if ( (lastbp= coin->lastpending) != 0 && lastbp->hdrsi < coin->bundlescount-1 )
coin->lastpending = coin->bundles[lastbp->hdrsi + 1];
iguana_setmaxbundles(coin);
/*if ( (rand() % 3) == 0 )
{
if ( coin->MAXBUNDLES > coin->endPEND )
@ -1149,6 +1156,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
if ( firstgap != 0 && firstgap->queued == 0 )
iguana_bundleQ(coin,firstgap,1000);
}
iguana_setmaxbundles(coin);
strcpy(coin->statusstr,str);
coin->estsize = estsize;
}

Loading…
Cancel
Save