From f4841d2e0e0fccda9d8ecbeee4b1bed2f6c32029 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Apr 2016 16:56:41 -0500 Subject: [PATCH] test --- iguana/iguana777.h | 2 +- iguana/iguana_unspents.c | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 3ea013817..9970fd4ab 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -432,7 +432,7 @@ struct iguana_bundle { struct queueitem DL; struct iguana_info *coin; struct iguana_bundle *nextbp; struct iguana_bloom16 bloom; int64_t totaldurations,duplicatedurations; int32_t durationscount,duplicatescount; - uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,utxofinish,balancefinish,validated,lastspeculative,dirty,nexttime,currenttime,lastprefetch,lastRT,missingstime,unsticktime; + uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,utxofinish,balancefinish,validated,lastspeculative,dirty,nexttime,currenttime,lastprefetch,lastRT,missingstime,unsticktime,converted; 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; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index b8e1469b7..fe572c8f1 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1690,15 +1690,19 @@ int32_t iguana_spendvectorconvs(struct iguana_info *coin,struct iguana_bundle *r for (j=0; jnumtmpspends; j++) { vec = &bp->tmpspends[j]; - if ( vec->hdrsi == refbp->hdrsi && iguana_spendvectorconv(coin,vec,bp) == 0 ) + if ( vec->hdrsi == refbp->hdrsi ) { - printf("iguana_spendvectorconv error [%d] at %d of %d/%d\n",bp->hdrsi,j,bp->numtmpspends,n); - return(-1); + if ( iguana_spendvectorconv(coin,vec,bp) == 0 ) + { + printf("iguana_spendvectorconv error [%d] at %d of %d/%d\n",bp->hdrsi,j,bp->numtmpspends,n); + return(-1); + } else converted++; } } } } - printf("spendvectorconvs.[%d] converted.%d\n",refbp->hdrsi,converted); + bp->converted = (uint32_t)time(NULL); + //printf("spendvectorconvs.[%d] converted.%d\n",refbp->hdrsi,converted); return(0); } @@ -1716,7 +1720,7 @@ int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int { if ( coin->origbalanceswritten <= 1 && coin->spendvectorsaved == 0 ) { - if ( bp->tmpspends != 0 && bp->ramchain.H.data != 0 && (n= bp->ramchain.H.data->numspends) != 0 ) + if ( bp->tmpspends != 0 && bp->ramchain.H.data != 0 && (n= bp->ramchain.H.data->numspends) != 0 && bp->converted == 0 ) { if ( iguana_spendvectorconvs(coin,bp) != 0 ) printf("error ram balancecalc.[%d]\n",bp->hdrsi); @@ -1727,9 +1731,12 @@ int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int if ( coin->bundles[i] == 0 || coin->bundles[i]->emitfinish <= 1 ) break; if ( i == n ) + { + printf("balance calc.%d of %d\n",i,n); iguana_spendvectorsaves(coin); + } } - } else printf("error with invalid tmpspends.[%d]\n",bp->hdrsi), getchar(); + } //else printf("error with invalid tmpspends.[%d]\n",bp->hdrsi), getchar(); } else retval = iguana_balancenormal(coin,bp,startheight,endheight); if ( retval < 0 ) {