From a1614a300da4d259a76e29c028d8234f9f2f282b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Apr 2016 00:37:11 -0600 Subject: [PATCH] test --- iguana/iguana777.h | 2 +- iguana/iguana_bundles.c | 2 +- iguana/iguana_recv.c | 28 ++++++++++++++++------------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 15ff233e5..8858349f9 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -43,7 +43,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDINGREQUESTS 2 -#define IGUANA_PENDINGREQUESTS 512 +#define IGUANA_PENDINGREQUESTS 32 #define IGUANA_MINPENDBUNDLES 2 #define IGUANA_MAXPENDBUNDLES 128 #define IGUANA_BUNDLELOOP 77 diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 3f3547c5a..58020b0a0 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -459,7 +459,7 @@ int32_t iguana_blocksmissing(struct iguana_info *coin,int32_t *nonzp,uint8_t mis } if ( bits256_nonz(hash2) != 0 ) { - if ( bp->issued[i] == 0 ) + if ( 0 && bp->issued[i] == 0 ) iguana_blockQ("missing",coin,bp,i,hash2,0); if ( now > bp->issued[i]+lag ) { diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 3552a6400..eb6cee28d 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -633,23 +633,27 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl block->bundlei = bundlei; block->hdrsi = bp->hdrsi; bp->blocks[bundlei] = block; - if ( bits256_nonz(bp->hashes[bundlei]) == 0 && bp->emitfinish == 0 ) + iguana_bundlehash2add(coin,0,bp,bundlei,hash2); + if ( bp->emitfinish == 0 ) { - block->fpos = -1; - checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1,0); - if ( (fp= fopen(fname,"rb")) != 0 ) + if ( bits256_nonz(bp->hashes[bundlei]) != 0 ) { - fseek(fp,0,SEEK_END); - block->RO.recvlen = (uint32_t)ftell(fp); - block->fpipbits = 1; - block->txvalid = 1; - block->fpos = 0; - printf("initialize with fp.[%d:%d] len.%d\n",hdrsi,bundlei,block->RO.recvlen); - fclose(fp); + block->fpos = -1; + checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1,0); + if ( (fp= fopen(fname,"rb")) != 0 ) + { + fseek(fp,0,SEEK_END); + block->RO.recvlen = (uint32_t)ftell(fp); + block->fpipbits = 1; + block->txvalid = 1; + block->fpos = 0; + //printf("initialize with fp.[%d:%d] len.%d\n",hdrsi,bundlei,block->RO.recvlen); + fclose(fp); + } } + else iguana_blockQ("bundleset",coin,bp,bundlei,block->RO.hash2,0); } //printf("bundlehashadd set.%d\n",bundlei); - iguana_bundlehash2add(coin,0,bp,bundlei,hash2); if ( bundlei > 0 ) { //printf("bundlehashadd prev %d\n",bundlei);