From 138ad07c2d8679bb2fa788f060abf9a036e879f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Apr 2016 14:43:49 -0600 Subject: [PATCH] test --- iguana/iguana777.h | 2 +- iguana/iguana_unspents.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index a7b683abe..8b5d870dc 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -350,7 +350,7 @@ struct iguana_hhaccount { UT_hash_handle hh; uint8_t buf[6]; struct iguana_accou struct iguana_hhutxo { UT_hash_handle hh; uint8_t buf[6]; struct iguana_utxo u; } __attribute__((packed)); // GLOBAL one zero to non-zero write (unless reorg) -struct iguana_spendvector { uint64_t value; uint32_t pkind,unspentind; uint16_t hdrsi,bundlei:11,tbd:4,tmpflag:1; } __attribute__((packed)); // unspentind +struct iguana_spendvector { uint64_t value; uint32_t pkind,unspentind; int32_t fromheight; uint16_t hdrsi:15,tmpflag:1; } __attribute__((packed)); // unspentind //struct iguana_pkextra { uint32_t firstspendind; } __attribute__((packed)); // pkind struct iguana_txblock diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index c519ded6b..80585f7d0 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -697,6 +697,7 @@ uint32_t iguana_spendvectorconv(struct iguana_info *coin,struct iguana_spendvect count++; if ( (count % 10000) == 0 ) printf("iguana_spendvectorconv.[%llu] errs.%llu converted.%llu %.2f%%\n",(long long)count,(long long)errs,(long long)converted,100. * (long long)converted/count); + printf("[%d] tmpflag.%d u%d %.8f p%u\n",ptr->hdrsi,ptr->tmpflag,ptr->unspentind,dstr(ptr->value),ptr->pkind); if ( ptr->tmpflag != 0 ) { if ( ptr->hdrsi >= 0 && ptr->hdrsi < coin->bundlescount && (spentbp= coin->bundles[ptr->hdrsi]) != 0 ) @@ -833,11 +834,11 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp) memset(&ptr[emit],0,sizeof(ptr[emit])); if ( (ptr[emit].unspentind= spent_unspentind) != 0 && spentbp->hdrsi < bp->hdrsi ) { + ptr[emit].fromheight = bp->bundleheight + i; ptr[emit].hdrsi = spentbp->hdrsi; - ptr[emit].bundlei = i; ptr[emit].pkind = spent_pkind; ptr[emit].value = u->value; - //ptr[emit].txi = j; + printf("ht.%d [%d] SPENDVECTOR u%d %.8f p%u\n",ptr[emit].fromheight,ptr[emit].hdrsi,ptr[emit].unspentind,dstr(ptr[emit].value),ptr[emit].pkind); //printf("(%d u%d).%d ",spentbp->hdrsi,unspentind,emit); emit++; } @@ -858,10 +859,9 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp) else { ptr[emit].hdrsi = spentbp->hdrsi; - ptr[emit].bundlei = i; + ptr[emit].fromheight = bp->bundleheight + i; ptr[emit].tmpflag = 1; - //ptr[emit].txi = j; - //printf("(%d u%d).%d ",spentbp->hdrsi,unspentind,emit); + printf("ht.%d [%d] TMPVECTOR u%d\n",ptr[emit].fromheight,ptr[emit].hdrsi,ptr[emit].unspentind); emit++; } } @@ -963,7 +963,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp,int3 spent_pkind = spend->pkind; spent_unspentind = spend->unspentind; spent_hdrsi = spend->hdrsi; - h = spend->bundlei + (spent_hdrsi * coin->chain->bundlesize); + h = spend->fromheight;//bundlei + (spent_hdrsi * coin->chain->bundlesize); emit++; } }