diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index a1bfc9fec..c476612fd 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -532,9 +532,9 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int if ( flag != 0 && priority != 0 && laggard != 0 ) printf("[%d] reissued.%d currentflag.%d ht.%d s.%d finished.%d most.%d laggards.%d maxunfinished.%d\n",bp->hdrsi,flag,bp->currentflag,bp->bundleheight,bp->numsaved,finished,doneval,laggard,maxval); } + if ( bp == coin->current ) + return(counter); } - if ( bp == coin->current ) - return(counter); for (i=0; in; i++) { if ( (block= bp->blocks[i]) != 0 ) @@ -604,8 +604,8 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32 } break; } - else if ( bp->blocks[i] == 0 ) - break; + // else if ( bp->blocks[i] == 0 ) + // break; } } return(counter); @@ -642,7 +642,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) { if ( bits256_nonz(bp->hashes[bundlei]) > 0 && (block= bp->blocks[bundlei]) != 0 ) { - //if ( block == iguana_blockfind(coin,bp->hashes[bundlei]) ) + if ( bits256_cmp(block->RO.hash2,bp->hashes[bundlei]) == 0 ) { if ( (checki= iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,bp->hashes[bundlei],bundlei>0?bp->hashes[bundlei-1]:zero,1)) != bundlei || bundlei < 0 || bundlei >= coin->chain->bundlesize ) { @@ -661,7 +661,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) } fclose(fp); }*/ - bp->blocks[bundlei] = block; + //bp->blocks[bundlei] = block; block->hdrsi = bp->hdrsi, block->bundlei = bundlei; if ( bp->minrequests == 0 || (block->numrequests > 0 && block->numrequests < bp->minrequests) ) bp->minrequests = block->numrequests; @@ -685,7 +685,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) //block->fpos = -1; //block->issued = bp->issued[bundlei] = 0; }*/ - } + } else printf("bundlecalc: mismatched block vs hash [%d:%d]\n",bp->hdrsi,bundlei); /*else if ( 0 ) { bp->blocks[bundlei] = iguana_blockfind(coin,bp->hashes[bundlei]); diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 94328c7ca..de5bc1b6a 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -249,6 +249,7 @@ int32_t iguana_peerfname(struct iguana_info *coin,int32_t *hdrsip,char *dirname, { struct iguana_bundle *bp = 0; int32_t bundlei = -2; char str[65]; *hdrsip = -1; ipbits = 0; + fname[0] = 0; //if ( ipbits == 0 ) // printf("illegal ipbits.%d\n",ipbits), getchar(); if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,hash2)) == 0 )