Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a8ecd538b3
  1. 6
      iguana/iguana777.c
  2. 3
      iguana/iguana_ramchain.c
  3. 5
      iguana/iguana_unspents.c

6
iguana/iguana777.c

@ -454,7 +454,6 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert
iguana_volatilesalloc(coin,&bp->ramchain,i < hdrsi);
for (; hdrsi<max; hdrsi++)
{
//iguana_ramchain_prefetch(coin,&coin->bundles[hdrsi]->ramchain,3);
if ( (bp= coin->bundles[hdrsi]) != 0 )
{
if ( iguana_balancegen(coin,0,bp,0,coin->chain->bundlesize-1,0) == 0 )
@ -463,9 +462,10 @@ int32_t iguana_utxogen(struct iguana_info *coin,int32_t helperid,int32_t convert
}
if ( max != coin->origbalanceswritten )
{
coin->balanceswritten = max;
coin->balanceflush = coin->balanceswritten;
}
while ( coin->balanceswritten != max )
sleep(3);
} else printf("skip flush when max.%d and orig.%d\n",max,coin->origbalanceswritten);
}
for (i=0; i<max; i++)
if ( (bp= coin->bundles[i]) != 0 )

3
iguana/iguana_ramchain.c

@ -1465,6 +1465,7 @@ struct iguana_ramchain *_iguana_ramchain_map(struct iguana_info *coin,char *fnam
{
if ( allocextras > 0 )
{
ramchain->height = ramchain->H.data->height;
if ( iguana_ramchain_extras(coin,ramchain,ramchain->hashmem,allocextras) == 0 && bp != 0 )
{
bp->balancefinish = (uint32_t)time(NULL);
@ -1500,6 +1501,7 @@ struct iguana_ramchain *iguana_ramchain_map(struct iguana_info *coin,char *fname
static portable_mutex_t mutex;
portable_mutex_lock(&mutex);
#endif
ramchain->height = bp->bundleheight;
retptr = _iguana_ramchain_map(coin,fname,bp,numblocks,ramchain,hashmem,ipbits,hash2,prevhash2,bundlei,fpos,allocextras,expanded);
#ifdef __PNACL__
portable_mutex_unlock(&mutex);
@ -2328,6 +2330,7 @@ struct iguana_ramchain *iguana_bundleload(struct iguana_info *coin,struct iguana
{
//printf("couldnt load bundle.%d\n",bp->bundleheight);
memset(&bp->ramchain,0,sizeof(bp->ramchain));
bp->ramchain.height = bp->bundleheight;
bp->emitfinish = 0;
//iguana_bundleremove(coin,bp->hdrsi,0);
}

5
iguana/iguana_unspents.c

@ -1549,11 +1549,6 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi)
char fname[1024],fname2[1024],destfname[1024]; bits256 balancehash,allbundles; FILE *fp,*fp2;
struct iguana_utxo *Uptr; struct iguana_account *Aptr; struct sha256_vstate vstate,bstate;
vupdate_sha256(balancehash.bytes,&vstate,0,0);
/*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 = refhdrsi;
vupdate_sha256(balancehash.bytes,&vstate,0,0);
vupdate_sha256(allbundles.bytes,&bstate,0,0);

Loading…
Cancel
Save