From e6b94020cf3957f7a4c6af134da25ba647fa378a Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 22 Apr 2016 22:05:30 -0500 Subject: [PATCH] test --- iguana/iguana_unspents.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 90b377f16..ee6fcc837 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -206,19 +206,24 @@ void iguana_volatilespurge(struct iguana_info *coin,struct iguana_ramchain *ramc free(ramchain->A2); } if ( ramchain->allocatedU2 != 0 && ramchain->Uextras != 0 && ramchain->Uextras != ramchain->lastspendsfileptr ) - free(ramchain->Uextras); + { + if ( ramchain->height > 0 ) + free(ramchain->Uextras); + } ramchain->A2 = 0; ramchain->Uextras = 0; ramchain->allocatedA2 = ramchain->allocatedU2 = 0; if ( ramchain->debitsfileptr != 0 ) { - munmap(ramchain->debitsfileptr,ramchain->debitsfilesize); + if ( ramchain->height > 0 ) + munmap(ramchain->debitsfileptr,ramchain->debitsfilesize); ramchain->debitsfileptr = 0; ramchain->debitsfilesize = 0; } if ( ramchain->lastspendsfileptr != 0 ) { - munmap(ramchain->lastspendsfileptr,ramchain->lastspendsfilesize); + if ( ramchain->height > 0 ) + munmap(ramchain->lastspendsfileptr,ramchain->lastspendsfilesize); ramchain->lastspendsfileptr = 0; ramchain->lastspendsfilesize = 0; } @@ -868,6 +873,7 @@ uint32_t iguana_fastfindinit(struct iguana_info *coin) break; else { + fprintf(stderr,"."); sorted = coin->fast[i]; coin->fast[i] = calloc(1,coin->fastsizes[i]); memcpy(coin->fast[i],sorted,coin->fastsizes[i]); @@ -1428,7 +1434,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st } for (k=0; kcurrent )//&& (spendind % 100) == 0 ) + if ( bp == coin->current && (spendind % 1000) == 0 ) printf("[%-3d:%4d] spendvectors elapsed t.%-3d spendind.%d\n",bp->hdrsi,i,(uint32_t)time(NULL)-starttime,spendind); u = 0; spentbp = 0; @@ -1512,7 +1518,6 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st break; } } - printf("s.%d\n",spendind); } } }