diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 10966c449..a65f83a41 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -40,7 +40,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define _IGUANA_MAXPENDING 3 #define IGUANA_MINPENDBUNDLES 16 #define IGUANA_MAXPENDBUNDLES 64 -#define IGUANA_BUNDLELOOP 7777 +#define IGUANA_BUNDLELOOP 777 #define IGUANA_RPCPORT 7778 #define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 5bca4aca1..c58db04b5 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -419,7 +419,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp,int bp->checkedtmp++; } } - bp->estsize = (bp->datasize * bp->n) / (bp->numrecv+1); + bp->estsize = ((int64_t)bp->datasize * bp->n) / (bp->numrecv+1); //bp->metric = bp->numhashes; bp->metric = coin->bundlescount - bp->hdrsi;//1000 + sqrt(sqrt(bp->n * (1 + bp->numsaved + bp->numrecv)) * (10 + coin->bundlescount - bp->hdrsi)); if ( done > coin->bundlescount*IGUANA_HEADPERCENTAGE && bp->hdrsi > coin->bundlescount*IGUANA_TAILPERCENTAGE ) @@ -477,9 +477,11 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) firstgap = lastpending = bp; else if ( ++pending == coin->MAXBUNDLES ) lastpending = bp; - spaceused += bp->estsize; if ( spaceused < coin->MAXMEM ) + { + spaceused += bp->estsize; lastpending = bp; + } sortbuf[m*2] = bp->metric; sortbuf[m*2 + 1] = i; m++; diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index c3b4d3b85..71dadc2f0 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -377,8 +377,8 @@ uint32_t iguana_allhashcmp(struct iguana_info *coin,struct iguana_bundle *bp,bit prev->hh.next = block; block->hh.prev = prev; } - if ( bp->hdrsi < coin->MAXBUNDLES ) - iguana_blockQ(coin,bp,i,blockhashes[i],0); + //if ( bp->hdrsi < coin->MAXBUNDLES ) + // iguana_blockQ(coin,bp,i,blockhashes[i],0); } else printf("no allhashes block.%p or mismatch.%p\n",block,bp->blocks[i]); prev = block; } @@ -1050,9 +1050,11 @@ int32_t iguana_blockQ(struct iguana_info *coin,struct iguana_bundle *bp,int32_t block = iguana_blockfind(coin,hash2); if ( priority != 0 || block == 0 || (block->queued == 0 && block->fpipbits == 0) ) { + if ( bp != 0 && bundlei >= 0 && bundlei < bp->n && block == 0 ) + block = bp->blocks[bundlei]; if ( block != 0 && bits256_cmp(coin->APIblockhash,hash2) != 0 ) { - if ( block->fpipbits != 0 || block->queued != 0 || block->issued > time(NULL)-60 ) + if ( block->fpipbits != 0 || block->queued != 0 || block->RO.recvlen != 0 )//block->issued > time(NULL)-60 ) return(0); } if ( priority != 0 ) @@ -1060,19 +1062,6 @@ int32_t iguana_blockQ(struct iguana_info *coin,struct iguana_bundle *bp,int32_t else str = "blocksQ", Q = &coin->blocksQ; if ( Q != 0 ) { - if ( bp != 0 && bundlei >= 0 && bundlei < bp->n ) - { - if ( bp->issued[bundlei] == 0 || time(NULL) > bp->issued[bundlei]+30 ) - { - bp->issued[bundlei] = (uint32_t)time(NULL); - if ( bp->bundleheight >= 0 ) - height = (bp->bundleheight + bundlei); - } - else - { - return(1); - } - } req = mycalloc('y',1,sizeof(*req)); req->hash2 = hash2; req->bp = bp;