|
@ -616,7 +616,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in |
|
|
// main context, ie single threaded
|
|
|
// main context, ie single threaded
|
|
|
struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_block **blockp,int32_t *bundleip,struct iguana_block *origblock) |
|
|
struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_block **blockp,int32_t *bundleip,struct iguana_block *origblock) |
|
|
{ |
|
|
{ |
|
|
struct iguana_block *block,*prevblock; bits256 zero,hash2,prevhash2; struct iguana_bundle *prevbp,*bp = 0; int32_t hdrsi,checki,prevbundlei,bundlei = -2; char fname[1024]; FILE *fp; |
|
|
struct iguana_block *block,*prevblock; bits256 zero,hash2,prevhash2; struct iguana_bundle *prevbp,*bp = 0; int32_t prevbundlei,bundlei = -2; struct iguana_ramchain blockR; |
|
|
*bundleip = -2; *blockp = 0; |
|
|
*bundleip = -2; *blockp = 0; |
|
|
if ( origblock == 0 ) |
|
|
if ( origblock == 0 ) |
|
|
return(0); |
|
|
return(0); |
|
@ -641,7 +641,11 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl |
|
|
block->hdrsi = bp->hdrsi; |
|
|
block->hdrsi = bp->hdrsi; |
|
|
bp->blocks[bundlei] = block; |
|
|
bp->blocks[bundlei] = block; |
|
|
iguana_bundlehash2add(coin,0,bp,bundlei,hash2); |
|
|
iguana_bundlehash2add(coin,0,bp,bundlei,hash2); |
|
|
if ( bp->hdrsi == coin->longestchain/bp->n && bp->emitfinish == 0 && block->txvalid == 0 ) //bits256_nonz(block->RO.hash2) != 0 && b
|
|
|
if ( iguana_ramchainfile(coin,0,&blockR,bp,bundlei,block) == 0 ) |
|
|
|
|
|
iguana_ramchain_free(coin,&blockR,1); |
|
|
|
|
|
else if ( block->issued == 0 ) |
|
|
|
|
|
iguana_blockQ("bundleset",coin,bp,bundlei,block->RO.hash2,coin->current == 0 || bp->hdrsi <= coin->current->hdrsi+coin->MAXBUNDLES); |
|
|
|
|
|
/*if ( bp->hdrsi == coin->longestchain/bp->n && bp->emitfinish == 0 && block->txvalid == 0 ) //bits256_nonz(block->RO.hash2) != 0 && b
|
|
|
{ |
|
|
{ |
|
|
block->fpos = -1; |
|
|
block->fpos = -1; |
|
|
checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,block->RO.hash2,zero,1,0); |
|
|
checki = iguana_peerfname(coin,&hdrsi,GLOBALTMPDIR,fname,0,block->RO.hash2,zero,1,0); |
|
@ -660,6 +664,7 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl |
|
|
} |
|
|
} |
|
|
if ( block->issued == 0 ) |
|
|
if ( block->issued == 0 ) |
|
|
iguana_blockQ("bundleset",coin,bp,bundlei,block->RO.hash2,coin->current == 0 || bp->hdrsi <= coin->current->hdrsi+coin->MAXBUNDLES); |
|
|
iguana_blockQ("bundleset",coin,bp,bundlei,block->RO.hash2,coin->current == 0 || bp->hdrsi <= coin->current->hdrsi+coin->MAXBUNDLES); |
|
|
|
|
|
*/ |
|
|
//printf("bundlehashadd set.%d\n",bundlei);
|
|
|
//printf("bundlehashadd set.%d\n",bundlei);
|
|
|
if ( bundlei > 0 ) |
|
|
if ( bundlei > 0 ) |
|
|
{ |
|
|
{ |
|
|