From 655bc3977358914a34242261ed1309727808f868 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Apr 2016 12:02:04 -0600 Subject: [PATCH] test --- iguana/iguana_bundles.c | 6 +++--- iguana/iguana_ramchain.c | 2 +- iguana/iguana_unspents.c | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index cb7fbb7b7..91da0931c 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -376,7 +376,7 @@ void iguana_bundlepurgefiles(struct iguana_info *coin,struct iguana_bundle *bp) { static bits256 zero; char fname[1024]; int32_t hdrsi,m,j; uint32_t ipbits; - if ( bp->emitfinish > coin->startutc && bp->purgetime == 0 && time(NULL) > bp->emitfinish+30 ) + if ( bp->purgetime == 0 && time(NULL) > bp->emitfinish+30 ) { for (j=m=0; jpeers.active)/sizeof(*coin->peers.active); j++) { @@ -644,7 +644,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp,int { int32_t bundlei,numhashes,avail,numsaved,numrecv,minrequests; uint8_t missings[IGUANA_MAXBUNDLESIZE/8+1]; int64_t datasize; struct iguana_block *block; - if ( bp->emitfinish > coin->startutc ) + if ( bp->emitfinish > 1 ) { bp->numhashes = bp->numsaved = bp->numcached = bp->numrecv = bp->n; return(bp->datasize); @@ -688,7 +688,7 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp) return(0); #endif for (i=0; ihdrsi; i++) - if ( (prevbp= coin->bundles[i]) == 0 || prevbp->emitfinish < coin->startutc || prevbp->utxofinish == 0 ) + if ( (prevbp= coin->bundles[i]) == 0 || prevbp->emitfinish <= 1 || prevbp->utxofinish == 0 ) break; if ( bp->hdrsi < coin->blocks.hwmchain.height/coin->chain->bundlesize && i == bp->hdrsi && time(NULL) > bp->emitfinish+10 )//&& coin->emitbusy <= 4 ) { diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 2ef2aad09..dcc49fc31 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -2496,7 +2496,7 @@ void iguana_ramchainmerge(struct iguana_info *coin) // jl777: verify prev/next h while ( bp != 0 && (nextbp= bp->nextbp) != 0 ) { n++; - if ( nextbp != 0 && bp != 0 && bp->emitfinish > coin->startutc && nextbp->emitfinish > coin->startutc && bp->mergefinish == 0 && nextbp->mergefinish == 0 && bp->ramchain.datasize + nextbp->ramchain.datasize < IGUANA_MAXRAMCHAINSIZE ) + if ( nextbp != 0 && bp != 0 && bp->emitfinish > 1 && nextbp->emitfinish > 1 && bp->mergefinish == 0 && nextbp->mergefinish == 0 && bp->ramchain.datasize + nextbp->ramchain.datasize < IGUANA_MAXRAMCHAINSIZE ) { if ( total == 0 || (bp->ramchain.datasize + nextbp->ramchain.datasize) < total ) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 10dffb15c..865e02f52 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -344,7 +344,7 @@ int32_t iguana_ramchain_spendtxid(struct iguana_info *coin,uint32_t *unspentindp ind = s->spendtxidind; external = (ind >> 31) & 1; ind &= ~(1 << 31); - printf("s.%p ramchaintxid vout.%x spendtxidind.%d isext.%d ext.%d ind.%d\n",s,s->prevout,ind,s->external,external,ind); + //printf("s.%p ramchaintxid vout.%x spendtxidind.%d isext.%d ext.%d ind.%d\n",s,s->prevout,ind,s->external,external,ind); if ( s->prevout < 0 ) return(-1); if ( s->external != 0 && s->external == external && ind < numexternaltxids ) @@ -367,12 +367,11 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st uint8_t *TXbits; struct iguana_txid *T; uint32_t txidind; int32_t i,j; struct iguana_bundle *bp; struct iguana_ramchain *ramchain; struct iguana_block *block; *heightp = -1; - printf("txid search lasthdrsi.%d RT.%p\n",lasthdrsi,&coin->RTramchain); if ( lasthdrsi < 0 ) return(0); for (i=lasthdrsi; i>=0; i--) { - printf("search.[%d] %p finish.%u vs %u\n",i,coin->bundles[i],coin->bundles[i]!=0?coin->bundles[i]->emitfinish:-1,coin->startutc); + //printf("search.[%d] %p finish.%u vs %u\n",i,coin->bundles[i],coin->bundles[i]!=0?coin->bundles[i]->emitfinish:-1,coin->startutc); if ( (bp= coin->bundles[i]) != 0 && bp->emitfinish > 1 ) { ramchain = (bp->isRT != 0) ? &coin->RTramchain : &bp->ramchain; @@ -380,7 +379,7 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st { TXbits = (void *)(long)((long)ramchain->H.data + ramchain->H.data->TXoffset); T = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Toffset); -printf("[%p] search bp.%p TXbits.%p T.%p %d %d\n",ramchain,bp,TXbits,T,(int32_t)ramchain->H.data->TXoffset,(int32_t)ramchain->H.data->Toffset); +//printf("[%p] search bp.%p TXbits.%p T.%p %d %d\n",ramchain,bp,TXbits,T,(int32_t)ramchain->H.data->TXoffset,(int32_t)ramchain->H.data->Toffset); if ( (txidind= iguana_sparseaddtx(TXbits,ramchain->H.data->txsparsebits,ramchain->H.data->numtxsparse,txid,T,0,ramchain)) > 0 ) { //printf("found txidind.%d\n",txidind); @@ -414,7 +413,7 @@ struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *pre struct iguana_bundle *spentbp=0; struct iguana_txid *T,TX,*tp; bits256 *X; bits256 prev_hash; X = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Xoffset); T = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Toffset); - printf("external X.%p %ld num.%d\n",X,(long)ramchain->H.data->Xoffset,(int32_t)ramchain->H.data->numexternaltxids); + //printf("external X.%p %ld num.%d\n",X,(long)ramchain->H.data->Xoffset,(int32_t)ramchain->H.data->numexternaltxids); sequenceid = s->sequenceid; hdrsi = spent_hdrsi; *unspentindp = 0;