From 0bce90921df81085451dc7c363724283b06a5df2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Apr 2016 23:41:13 -0500 Subject: [PATCH] test --- iguana/iguana_ramchain.c | 4 +++- iguana/iguana_unspents.c | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 5aa918a01..83e91a449 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -2350,7 +2350,9 @@ int64_t iguana_ramchainopen(char *fname,struct iguana_info *coin,struct iguana_r _iguana_ramchain_setptrs(RAMCHAIN_PTRS,ramchain->H.data); iguana_ramchain_extras(coin,ramchain,hashmem,0); } - return(ramchain->H.data->allocsize); + if ( rdata != 0 ) + return(rdata->allocsize); + else return(0); } int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_ramchain *mapchain,struct iguana_bundle *bp,int32_t bundlei,struct iguana_block *block,void *ptr,long filesize) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 10e16e29f..b9181da2d 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1358,16 +1358,26 @@ void iguana_initfinal(struct iguana_info *coin,bits256 lastbundle) printf("initfinal break.[%d]: bp.%p or emit.%u utxofinish.%u\n",i,bp,bp!=0?bp->emitfinish:-1,bp!=0?bp->utxofinish:-1); break; } + if ( i == 0 ) + bp->utxofinish = bp->startutxo = (uint32_t)time(NULL); } if ( i < coin->bundlescount-1 ) { - //printf("spendvectors.[%d] max.%d missing, will regen all of them\n",i,coin->bundlescount-1); + printf("spendvectors.[%d] max.%d missing, will regen all of them\n",i,coin->bundlescount-1); for (i=0; ibundlescount-1; i++) { if ( (bp= coin->bundles[i]) != 0 ) bp->startutxo = bp->utxofinish = 0; } } + else + { + for (i=0; ibundlescount-1; i++) + { + if ( (bp= coin->bundles[i]) != 0 ) + bp->balancefinish = (uint32_t)time(NULL); + } + } printf("i.%d bundlescount.%d\n",i,coin->bundlescount); if ( coin->balanceswritten > 1 ) coin->balanceswritten = iguana_volatilesinit(coin);