|
@ -1291,31 +1291,33 @@ struct iguana_bundle *iguana_bundleset(struct supernet_info *myinfo,struct iguan |
|
|
iguana_bundlespeculate(coin,bp,bundlei,hash2,1); |
|
|
iguana_bundlespeculate(coin,bp,bundlei,hash2,1); |
|
|
} |
|
|
} |
|
|
prevbp = 0, prevbundlei = -2; |
|
|
prevbp = 0, prevbundlei = -2; |
|
|
iguana_bundlefind(coin,&prevbp,&prevbundlei,prevhash2); |
|
|
if (bits256_nonz(prevhash2)) { |
|
|
//if ( 0 && block->blockhashes != 0 )
|
|
|
iguana_bundlefind(coin, &prevbp, &prevbundlei, prevhash2); |
|
|
// fprintf(stderr,"has blockhashes bp.%p[%d] prevbp.%p[%d]\n",bp,bundlei,prevbp,prevbundlei);
|
|
|
//if ( 0 && block->blockhashes != 0 )
|
|
|
if ( prevbp != 0 && prevbundlei >= 0 && (prevblock= iguana_blockfind("bundleset2",coin,prevhash2)) != 0 ) |
|
|
// fprintf(stderr,"has blockhashes bp.%p[%d] prevbp.%p[%d]\n",bp,bundlei,prevbp,prevbundlei);
|
|
|
{ |
|
|
if (prevbp != 0 && prevbundlei >= 0 && (prevblock = iguana_blockfind("bundleset2", coin, prevhash2)) != 0) |
|
|
if ( prevbundlei < coin->chain->bundlesize ) |
|
|
{ |
|
|
{ |
|
|
if (prevbundlei < coin->chain->bundlesize) |
|
|
if ( prevbp->hdrsi+1 == coin->bundlescount && prevbundlei == coin->chain->bundlesize-1 ) |
|
|
{ |
|
|
{ |
|
|
if (prevbp->hdrsi + 1 == coin->bundlescount && prevbundlei == coin->chain->bundlesize - 1) |
|
|
printf("%s AUTOCREATE.%d\n",coin->symbol,prevbp->bundleheight + coin->chain->bundlesize); |
|
|
{ |
|
|
if ( (bp= iguana_bundlecreate(coin,bundleip,prevbp->bundleheight + coin->chain->bundlesize,hash2,zero,0)) != 0 ) |
|
|
printf("%s AUTOCREATE.%d\n", coin->symbol, prevbp->bundleheight + coin->chain->bundlesize); |
|
|
{ |
|
|
if ((bp = iguana_bundlecreate(coin, bundleip, prevbp->bundleheight + coin->chain->bundlesize, hash2, zero, 0)) != 0) |
|
|
if ( bp->queued == 0 ) |
|
|
{ |
|
|
iguana_bundleQ(myinfo,coin,bp,1000); |
|
|
if (bp->queued == 0) |
|
|
} |
|
|
iguana_bundleQ(myinfo, coin, bp, 1000); |
|
|
} |
|
|
} |
|
|
if ( prevbundlei < coin->chain->bundlesize-1 ) |
|
|
} |
|
|
{ |
|
|
if (prevbundlei < coin->chain->bundlesize - 1) |
|
|
//printf("bundlehash2add next %d\n",prevbundlei);
|
|
|
{ |
|
|
iguana_bundlehash2add(coin,0,prevbp,prevbundlei+1,hash2); |
|
|
//printf("bundlehash2add next %d\n",prevbundlei);
|
|
|
} |
|
|
iguana_bundlehash2add(coin, 0, prevbp, prevbundlei + 1, hash2); |
|
|
if ( 1 && strcmp("BTC",coin->symbol) != 0 ) |
|
|
} |
|
|
iguana_bundlespeculate(coin,prevbp,prevbundlei,prevhash2,2); |
|
|
if (1 && strcmp("BTC", coin->symbol) != 0) |
|
|
} |
|
|
iguana_bundlespeculate(coin, prevbp, prevbundlei, prevhash2, 2); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else printf("iguana_bundleset: error adding blockhash\n"); |
|
|
} else printf("iguana_bundleset: error adding blockhash\n"); |
|
|
bp = 0, *bundleip = -2; |
|
|
bp = 0, *bundleip = -2; |
|
|
return(iguana_bundlefind(coin,&bp,bundleip,hash2)); |
|
|
return(iguana_bundlefind(coin,&bp,bundleip,hash2)); |
|
|