diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 09df3deb6..ebcc65290 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -435,7 +435,7 @@ struct iguana_bundle struct queueitem DL; struct iguana_info *coin; struct iguana_bundle *nextbp; struct iguana_bloom16 bloom; //uint32_t rawscriptspace; uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,utxofinish,balancefinish,validated,lastspeculative,dirty,nexttime,currenttime,lastprefetch,missingstime; - int32_t numhashes,numrecv,numsaved,numcached,generrs,currentflag,origmissings; + int32_t numhashes,numrecv,numsaved,numcached,generrs,currentflag,origmissings,numissued; int32_t minrequests,n,hdrsi,bundleheight,numtxids,numspends,numunspents,numspec,isRT; double avetime,threshold,metric; uint64_t datasize,estsize; struct iguana_block *blocks[IGUANA_MAXBUNDLESIZE]; diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 9c7f7f13f..480cea8d8 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -876,10 +876,11 @@ int32_t iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp, if ( bp == coin->current ) lag = 10; missing = iguana_blocksmissing(coin,&avail,missings,0,bp,0,lag); - if ( bp->missingstime == 0 || (bp == coin->current && missing < (bp->origmissings >> 1)) || missing < (bp->origmissings>>3) || time(NULL) > bp->missingstime+lag ) + if ( bp->missingstime == 0 || bp->numissued < bp->n || (bp == coin->current && missing < (bp->origmissings >> 1)) || missing < (bp->origmissings>>3) || time(NULL) > bp->missingstime+lag ) { if ( (n= iguana_bundlerequests(coin,missings,&bp->origmissings,&tmp,bp,lag)) > 0 ) { + bp->numissued += n; printf("bundle.[%d] missings.%d n.%d capacity %d -> %d\n",bp->hdrsi,bp->origmissings,n,capacity,capacity-n); capacity -= n; bp->missingstime = (uint32_t)time(NULL);