From ff616a4a48e4b8726f3e60e70429d7a0eae7f7fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 21 Apr 2016 02:55:19 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 2 +- iguana/iguana777.h | 4 ++-- iguana/iguana_unspents.c | 27 +++++++++++---------------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 54c78d188..809346907 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -450,7 +450,7 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert hdrsi = 0; else hdrsi = coin->origbalanceswritten; for (i=0; ibundles[i]) != 0 ) + if ( (bp= coin->bundles[i]) != 0 && bp != coin->current ) iguana_volatilesalloc(coin,&bp->ramchain,i < hdrsi); for (; hdrsiH.data) != 0 ) { //printf("volatilesalloc.[%d]\n",rdata->height/coin->chain->bundlesize); - if ( ramchain->allocatedA == 0 ) + if ( ramchain->allocatedA2 == 0 ) { - ramchain->A = calloc(sizeof(*ramchain->A),rdata->numpkinds + 16); - ramchain->allocatedA = sizeof(*ramchain->A) * rdata->numpkinds; + ramchain->A2 = calloc(sizeof(*ramchain->A2),rdata->numpkinds + 16); + ramchain->allocatedA2 = sizeof(*ramchain->A2) * rdata->numpkinds; } - if ( ramchain->allocatedU == 0 ) + if ( ramchain->allocatedU2 == 0 ) { ramchain->Uextras = calloc(sizeof(*ramchain->Uextras),rdata->numunspents + 16); - ramchain->allocatedU = sizeof(*ramchain->Uextras) * rdata->numunspents; + ramchain->allocatedU2 = sizeof(*ramchain->Uextras) * rdata->numunspents; } if ( ramchain->debitsfileptr != 0 ) { @@ -196,13 +196,13 @@ void iguana_volatilespurge(struct iguana_info *coin,struct iguana_ramchain *ramc struct iguana_bundle *bp; if ( (bp= coin->current) != 0 && ramchain->height < bp->bundleheight ) { - if ( ramchain->allocatedA != 0 && ramchain->A != 0 ) - free(ramchain->A); - ramchain->A = 0; - if ( ramchain->allocatedU != 0 && ramchain->Uextras != 0 ) + if ( ramchain->allocatedA2 != 0 && ramchain->A2 != 0 ) + free(ramchain->A2); + ramchain->A2 = 0; + if ( ramchain->allocatedU2 != 0 && ramchain->Uextras != 0 ) free(ramchain->Uextras); ramchain->Uextras = 0; - ramchain->allocatedA = ramchain->allocatedU = 0; + ramchain->allocatedA2 = ramchain->allocatedU2 = 0; if ( ramchain->debitsfileptr != 0 ) { munmap(ramchain->debitsfileptr,ramchain->debitsfilesize); @@ -313,11 +313,6 @@ int32_t iguana_volatileupdate(struct iguana_info *coin,int32_t incremental,struc struct iguana_account *A2; struct iguana_ramchaindata *rdata; struct iguana_utxo *utxo; if ( (rdata= spentchain->H.data) != 0 ) { - /*if ( spentchain->allocatedA == 0 || spentchain->allocatedU == 0 ) - { - iguana_volatilesalloc(coin,spentchain,1); - fprintf(stderr,"volatilesalloc.[%d] ",spent_hdrsi); - }*/ if ( incremental == 0 ) { if ( spentchain->Uextras != 0 && (A2= spentchain->A) != 0 ) @@ -1602,7 +1597,7 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi) OS_removefile(fname,0); OS_removefile(fname2,0); } - if ( bp->ramchain.allocatedA == 0 || bp->ramchain.allocatedU == 0 ) + if ( bp->ramchain.allocatedA2 == 0 || bp->ramchain.allocatedU2 == 0 ) break; } else if ( hdrsi > 0 )