Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
fcf79d57f1
  1. 19
      iguana/iguana777.c
  2. 1
      iguana/iguana777.h
  3. 10
      iguana/iguana_unspents.c

19
iguana/iguana777.c

@ -381,10 +381,20 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid)
if ( iguana_spendvectorsaves(coin) == 0 )
{
for (hdrsi=0; hdrsi<coin->bundlescount-1; hdrsi++)
iguana_balancenormal(coin,bp,0,bp->n-1);
iguana_allocvolatile(coin,&coin->bundles[hdrsi]->ramchain);
for (hdrsi=0; hdrsi<coin->bundlescount-1; hdrsi++)
iguana_balancegen(coin,bp,0,bp->n-1);
if ( iguana_balanceflush(coin,coin->bundlescount-1,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);
}
while ( coin->spendvectorsaved == 1 )
{
printf("helperid.%d waiting for spendvectorsaved.%u\n",helperid,coin->spendvectorsaved);
sleep(3);
}
printf("helper.%d finished utxogen\n",helperid);
return(num);
}
@ -413,14 +423,7 @@ void iguana_helper(void *arg)
if ( (coin= Coins[i]) != 0 )
{
if ( coin->spendvectorsaved == 1 )
{
iguana_utxogen(coin,helperid);
while ( coin->spendvectorsaved == 1 )
{
printf("helperid.%d waiting for spendvectorsaved.%u\n",helperid,coin->spendvectorsaved);
sleep(3);
}
}
}
}
//if ( (type & (1 << 0)) != 0 )

1
iguana/iguana777.h

@ -863,6 +863,7 @@ int32_t iguana_emitfinished(struct iguana_info *coin);
int32_t iguana_utxofinished(struct iguana_info *coin);
int32_t iguana_balancefinished(struct iguana_info *coin);
int32_t iguana_alloctxbits(struct iguana_info *coin,struct iguana_ramchain *ramchain);
void iguana_allocvolatile(struct iguana_info *coin,struct iguana_ramchain *ramchain);
extern int32_t HDRnet,netBLOCKS;

10
iguana/iguana_unspents.c

@ -1384,12 +1384,12 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi,int32_t pu
char fname[1024],fname2[1024],destfname[1024]; bits256 balancehash; FILE *fp,*fp2;
struct iguana_utxo *Uptr; struct iguana_account *Aptr; struct sha256_vstate vstate;
vupdate_sha256(balancehash.bytes,&vstate,0,0);
for (hdrsi=0; hdrsi<coin->bundlescount; hdrsi++)
/*for (hdrsi=0; hdrsi<coin->bundlescount; hdrsi++)
if ( (bp= coin->bundles[hdrsi]) == 0 || bp->balancefinish <= 1 || bp->ramchain.H.data == 0 || bp->ramchain.A == 0 || bp->ramchain.Uextras == 0 )
break;
if ( hdrsi < coin->balanceswritten || hdrsi < refhdrsi )
return(0);
numhdrsi = hdrsi;
return(0);*/
numhdrsi = refhdrsi;
vupdate_sha256(balancehash.bytes,&vstate,0,0);
for (iter=0; iter<3; iter++)
{
@ -1532,7 +1532,7 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi,int32_t pu
return(coin->balanceswritten);
}
int32_t iguana_balancenormal(struct iguana_info *coin,struct iguana_bundle *bp,int32_t startheight,int32_t endheight)
/*int32_t iguana_balancenormal(struct iguana_info *coin,struct iguana_bundle *bp,int32_t startheight,int32_t endheight)
{
uint32_t starttime; int32_t j=0,n; struct iguana_bundle *prevbp;
n = coin->bundlescount - 1;
@ -1576,7 +1576,7 @@ int32_t iguana_balancenormal(struct iguana_info *coin,struct iguana_bundle *bp,i
return(0);
}
return(-1);
}
}*/
int32_t iguana_spendvectorsaves(struct iguana_info *coin)
{

Loading…
Cancel
Save