Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
bf5c820c25
  1. 2
      iguana/iguana777.c
  2. 5
      iguana/iguana_unspents.c
  3. 10
      iguana/main.c

2
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; hdrsi<coin->bundlescount; 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);

5
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
{

10
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; i<IGUANA_MAXCOINS; i++)
if ( (coin= Coins[i]) != 0 && coin->active != 0 )
iguana_coinflush(coin);
} else usleep(10000);
for (i=0; i<IGUANA_MAXCOINS; i++)
if ( (coin= Coins[i]) != 0 && coin->active != 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);
}
}
}

Loading…
Cancel
Save