From bf5c820c25f48f52d2779a787db0f3c3d102b4b7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Mar 2016 07:28:58 -0300 Subject: [PATCH] test --- iguana/iguana777.c | 2 +- iguana/iguana_unspents.c | 5 +++-- iguana/main.c | 10 ++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index e55af987a..04af5df1e 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -400,7 +400,7 @@ void iguana_coinflush(struct iguana_info *coin) int32_t hdrsi; struct iguana_bundle *bp; char fname[1024],fname2[1024]; FILE *fp,*fp2=0; for (hdrsi=0; hdrsibundlescount; hdrsi++) { - if ( (bp= coin->bundles[hdrsi]) != 0 && time(NULL) > bp->dirty+600 && bp->ramchain.H.data != 0 && bp->ramchain.A != 0 && bp->ramchain.Uextras != 0 ) + if ( (bp= coin->bundles[hdrsi]) != 0 && time(NULL) > bp->dirty+60 && bp->ramchain.H.data != 0 && bp->ramchain.A != 0 && bp->ramchain.Uextras != 0 ) { sprintf(fname,"accounts/%s/debits.%d",coin->symbol,bp->bundleheight); sprintf(fname2,"accounts/%s/lastspends.%d",coin->symbol,bp->bundleheight); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index c786e3780..4b4af731b 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -328,7 +328,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp) { int32_t spendind,n,errs=0,emit=0; uint32_t unspentind,pkind,txidind; struct iguana_account *A2; struct iguana_unspent *u,*spentU; struct iguana_spend *S,*s; struct iguana_ramchain *ramchain; - struct iguana_bundle *spentbp; struct iguana_txid *T; int32_t hdrsi; + struct iguana_bundle *spentbp; struct iguana_txid *T; int32_t hdrsi; uint32_t now; ramchain = &bp->ramchain; printf("BALANCEGEN.%d\n",bp->bundleheight); if ( ramchain->H.data == 0 || (n= ramchain->H.data->numspends) < 1 ) @@ -386,6 +386,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp) //printf("[%d] spendind.%d -> (hdrsi.%d u%d)\n",bp->hdrsi,spendind,hdrsi,unspentind); } else continue; + now = (uint32_t)time(NULL); if ( unspentind > 0 && unspentind < spentbp->ramchain.H.data->numunspents ) { if ( spentbp->ramchain.Uextras == 0 ) @@ -413,7 +414,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp) spentbp->ramchain.Uextras[unspentind] |= (1 << 31); A2[pkind].total += u->value; A2[pkind].lastind = spendind; - spentbp->dirty = (uint32_t)time(NULL); + spentbp->dirty = now; } else { diff --git a/iguana/main.c b/iguana/main.c index e0dab8f25..7f7ebcd0f 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -349,12 +349,9 @@ void mainloop(struct supernet_info *myinfo) iguana_balancecalc(ptr->coin,ptr->bp); myfree(ptr,ptr->allocsize); } - if ( flag != 0 ) - { - for (i=0; iactive != 0 ) - iguana_coinflush(coin); - } else usleep(10000); + for (i=0; iactive != 0 ) + iguana_coinflush(coin); iguana_jsonQ(); if ( flag == 0 ) { @@ -366,6 +363,7 @@ void mainloop(struct supernet_info *myinfo) } else*/ pangea_queues(SuperNET_MYINFO(0)); + usleep(10000); } } }