From 2e8ca6c11a042008c6c99cb2e6cad7d46ba027bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Apr 2016 22:41:17 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 21 +++++++++++---------- iguana/iguana_unspents.c | 4 +++- iguana/main.c | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 415b747c7..166c5b169 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -342,8 +342,9 @@ int32_t iguana_balancefinished(struct iguana_info *coin) int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid) { - int32_t hdrsi,retval,n,num = 0; struct iguana_bundle *bp; - for (hdrsi=helperid; hdrsibundlescount-1; hdrsi+=IGUANA_NUMHELPERS) + int32_t hdrsi,retval,n,max,num = 0; struct iguana_bundle *bp; + max = coin->bundlescount-1; + for (hdrsi=helperid; hdrsibundles[hdrsi]) == 0 ) return(-1); @@ -360,12 +361,12 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid) //iguana_balancesQ(coin,bp); } else printf("UTXO gen.[%d] utxo error\n",bp->hdrsi); } - while ( (n= iguana_utxofinished(coin)) < coin->bundlescount-1 ) + while ( (n= iguana_utxofinished(coin)) < max ) { - printf("helperid.%d utxofinished.%d vs %d\n",helperid,n,coin->bundlescount-1); + printf("helperid.%d utxofinished.%d vs %d\n",helperid,n,max); sleep(3); } - for (hdrsi=helperid; hdrsibundlescount-1; hdrsi+=IGUANA_NUMHELPERS) + for (hdrsi=helperid; hdrsibundles[hdrsi]) == 0 ) return(-1); @@ -373,18 +374,18 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid) } if ( helperid == 0 ) { - while ( (n= iguana_convertfinished(coin)) < coin->bundlescount-1 ) + while ( (n= iguana_convertfinished(coin)) < max ) { - printf("helperid.%d convertfinished.%d vs %d\n",helperid,n,coin->bundlescount-1); + printf("helperid.%d convertfinished.%d vs max %d bundlescount.%d\n",helperid,n,max,coin->bundlescount); sleep(3); } if ( iguana_spendvectorsaves(coin) == 0 ) { - for (hdrsi=0; hdrsibundlescount-1; hdrsi++) + for (hdrsi=0; hdrsibundles[hdrsi]->ramchain); - for (hdrsi=0; hdrsibundlescount-1; hdrsi++) + for (hdrsi=0; hdrsin-1); - if ( iguana_balanceflush(coin,coin->bundlescount-1,3) > 0 ) + if ( iguana_balanceflush(coin,max,3) > 0 ) printf("balanceswritten.%d flushed bp->hdrsi %d vs %d coin->longestchain/coin->chain->bundlesize\n",coin->balanceswritten,bp->hdrsi,coin->longestchain/coin->chain->bundlesize); } else printf("error saving spendvectors\n"); coin->spendvectorsaved = (uint32_t)time(NULL); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 9c2ae1ca9..19d353db7 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1663,7 +1663,9 @@ int32_t iguana_spendvectorconvs(struct iguana_info *coin,struct iguana_bundle *s } } } - } else printf("iguana_spendvectorconvs: [%d] null bp.%p or null tmpspends\n",i,bp); + } + else if ( bp->hdrsi > 0 && bp->hdrsi < coin->bundlescount-1 ) + printf("iguana_spendvectorconvs: [%d] null bp.%p or null tmpspends\n",i,bp); } spentbp->converted = (uint32_t)time(NULL); //printf("spendvectorconvs.[%d] converted.%d\n",refbp->hdrsi,converted); diff --git a/iguana/main.c b/iguana/main.c index 8c7292bed..0c2767649 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -388,7 +388,7 @@ void mainloop(struct supernet_info *myinfo) { isRT *= coin->isRT; numpeers += coin->peers.numranked; - if ( coin->spendvectorsaved == 0 ) + if ( coin->spendvectorsaved == 0 && time(NULL) > coin->startutc+10 ) { n = coin->bundlescount-1; if ( iguana_emitfinished(coin) >= n )