From a8ecd538b3279a81d229a4342142de929c3fbdd3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Apr 2016 14:04:36 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 6 +++--- iguana/iguana_ramchain.c | 3 +++ iguana/iguana_unspents.c | 5 ----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 809346907..bedd9894e 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -454,7 +454,6 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert iguana_volatilesalloc(coin,&bp->ramchain,i < hdrsi); for (; hdrsibundles[hdrsi]->ramchain,3); if ( (bp= coin->bundles[hdrsi]) != 0 ) { if ( iguana_balancegen(coin,0,bp,0,coin->chain->bundlesize-1,0) == 0 ) @@ -463,9 +462,10 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert } if ( max != coin->origbalanceswritten ) { - coin->balanceswritten = max; coin->balanceflush = coin->balanceswritten; - } + while ( coin->balanceswritten != max ) + sleep(3); + } else printf("skip flush when max.%d and orig.%d\n",max,coin->origbalanceswritten); } for (i=0; ibundles[i]) != 0 ) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index cf330f77e..aa69d2abb 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1465,6 +1465,7 @@ struct iguana_ramchain *_iguana_ramchain_map(struct iguana_info *coin,char *fnam { if ( allocextras > 0 ) { + ramchain->height = ramchain->H.data->height; if ( iguana_ramchain_extras(coin,ramchain,ramchain->hashmem,allocextras) == 0 && bp != 0 ) { bp->balancefinish = (uint32_t)time(NULL); @@ -1500,6 +1501,7 @@ struct iguana_ramchain *iguana_ramchain_map(struct iguana_info *coin,char *fname static portable_mutex_t mutex; portable_mutex_lock(&mutex); #endif + ramchain->height = bp->bundleheight; retptr = _iguana_ramchain_map(coin,fname,bp,numblocks,ramchain,hashmem,ipbits,hash2,prevhash2,bundlei,fpos,allocextras,expanded); #ifdef __PNACL__ portable_mutex_unlock(&mutex); @@ -2328,6 +2330,7 @@ struct iguana_ramchain *iguana_bundleload(struct iguana_info *coin,struct iguana { //printf("couldnt load bundle.%d\n",bp->bundleheight); memset(&bp->ramchain,0,sizeof(bp->ramchain)); + bp->ramchain.height = bp->bundleheight; bp->emitfinish = 0; //iguana_bundleremove(coin,bp->hdrsi,0); } diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 801b18e7c..283c2834d 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1549,11 +1549,6 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi) char fname[1024],fname2[1024],destfname[1024]; bits256 balancehash,allbundles; FILE *fp,*fp2; struct iguana_utxo *Uptr; struct iguana_account *Aptr; struct sha256_vstate vstate,bstate; vupdate_sha256(balancehash.bytes,&vstate,0,0); - /*for (hdrsi=0; hdrsibundlescount; hdrsi++) - if ( (bp= coin->bundles[hdrsi]) == 0 || bp->balancefinish <= 1 || bp->ramchain.H.data == 0 || bp->ramchain.A == 0 || bp->ramchain.Uextras == 0 ) - break; - if ( hdrsi < coin->balanceswritten || hdrsi < refhdrsi ) - return(0);*/ numhdrsi = refhdrsi; vupdate_sha256(balancehash.bytes,&vstate,0,0); vupdate_sha256(allbundles.bytes,&bstate,0,0);