Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
3d27c0d172
  1. 2
      iguana/iguana777.h
  2. 2
      iguana/iguana_bundles.c
  3. 5
      iguana/iguana_ramchain.c

2
iguana/iguana777.h

@ -32,6 +32,8 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_WIDTH 1024
#define IGUANA_HEIGHT 200
#define IGUANA_HEADPERCENTAGE 1.0
#define IGUANA_TAILPERCENTAGE 1.0
#define IGUANA_MAXPENDHDRS 1
#define _IGUANA_MAXPENDING 8 //64
#define _IGUANA_MAXBUNDLES 8

2
iguana/iguana_bundles.c

@ -403,7 +403,7 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp,int
}
//bp->metric = bp->numhashes;
bp->metric = 1000 + sqrt(sqrt(bp->n * (1 + bp->numsaved + bp->numrecv)) * (10 + coin->bundlescount - bp->hdrsi));
if ( done > coin->bundlescount/3 && bp->hdrsi > coin->bundlescount*.8 )
if ( done > coin->bundlescount*IGUANA_HEADPERCENTAGE && bp->hdrsi > coin->bundlescount*IGUANA_TAILPERCENTAGE )
bp->metric *= 1000;
return(bp->estsize);
}

5
iguana/iguana_ramchain.c

@ -1753,6 +1753,7 @@ int32_t iguana_ramchain_iterate(struct iguana_info *coin,struct iguana_ramchain
int32_t j,metalen,hdrsi,prevout,scriptlen; uint32_t sequenceid,destspendind=0,desttxidind=0;
bits256 prevhash; uint64_t value; uint8_t type,_script[IGUANA_MAXSCRIPTSIZE]; struct iguana_unspent *u; struct scriptdata *script;
struct iguana_txid *tx; struct iguana_ramchaindata *rdata; uint8_t *rmd160,*scriptdata;
printf("iterate ramchain.%p rdata.%p dest.%p ht.%d/%d\n",ramchain,ramchain->H.data,dest,bp->bundleheight,bp->n);
if ( (rdata= ramchain->H.data) == 0 )
{
printf("iguana_ramchain_iterate cant iterate without data\n");
@ -1760,7 +1761,7 @@ int32_t iguana_ramchain_iterate(struct iguana_info *coin,struct iguana_ramchain
}
if ( dest != 0 )
_iguana_ramchain_setptrs(RAMCHAIN_DESTPTRS,dest->H.data);
else printf("iterate %d/%d dest.%p ramchain.%p rdata.%p\n",bp->bundleheight,bp->n,dest,ramchain,rdata);
else fprintf(stderr,"iterate %d/%d dest.%p ramchain.%p rdata.%p\n",bp->bundleheight,bp->n,dest,ramchain,rdata);
_iguana_ramchain_setptrs(RAMCHAIN_PTRS,ramchain->H.data);
ramchain->H.ROflag = 1;
ramchain->H.unspentind = ramchain->H.spendind = ramchain->pkind = rdata->firsti;
@ -1770,6 +1771,7 @@ int32_t iguana_ramchain_iterate(struct iguana_info *coin,struct iguana_ramchain
desttxidind = dest->H.txidind;
destspendind = dest->H.spendind;
}
printf("txid loop\n");
for (ramchain->H.txidind=rdata->firsti; ramchain->H.txidind<rdata->numtxids; ramchain->H.txidind++)
{
if ( 1 && ramchain->expanded != 0 )
@ -2506,6 +2508,7 @@ if ( bp->bundleheight != 32000 )
{
if ( (block= bp->blocks[bundlei]) != 0 )
{
printf("blocksetcounters\n");
iguana_blocksetcounters(coin,block,dest);
coin->blocks.RO[bp->bundleheight+bundlei] = block->RO;
destB[bundlei] = block->RO;

Loading…
Cancel
Save