Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
2e8ca6c11a
  1. 21
      iguana/iguana777.c
  2. 4
      iguana/iguana_unspents.c
  3. 2
      iguana/main.c

21
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; hdrsi<coin->bundlescount-1; hdrsi+=IGUANA_NUMHELPERS)
int32_t hdrsi,retval,n,max,num = 0; struct iguana_bundle *bp;
max = coin->bundlescount-1;
for (hdrsi=helperid; hdrsi<max; hdrsi+=IGUANA_NUMHELPERS)
{
if ( (bp= coin->bundles[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; hdrsi<coin->bundlescount-1; hdrsi+=IGUANA_NUMHELPERS)
for (hdrsi=helperid; hdrsi<max; hdrsi+=IGUANA_NUMHELPERS)
{
if ( (bp= coin->bundles[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; hdrsi<coin->bundlescount-1; hdrsi++)
for (hdrsi=0; hdrsi<max; hdrsi++)
iguana_allocvolatile(coin,&coin->bundles[hdrsi]->ramchain);
for (hdrsi=0; hdrsi<coin->bundlescount-1; hdrsi++)
for (hdrsi=0; hdrsi<max; hdrsi++)
iguana_balancegen(coin,bp,0,bp->n-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);

4
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);

2
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 )

Loading…
Cancel
Save