Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
c2575e0d32
  1. 4
      iguana/iguana777.h
  2. 11
      iguana/iguana_bundles.c
  3. 8
      iguana/iguana_unspents.c

4
iguana/iguana777.h

@ -26,7 +26,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t
#define IGUANA_SERIALIZE_SPENDVECTORGEN
//#define IGUANA_SERIALIZE_BALANCEGEN
//#define IGUANA_DISABLEPEERS
#define _IGUANA_MAXSTUCKTIME 77
#define _IGUANA_MAXSTUCKTIME 3600
#define IGUANA_MAXITERATIONS 10000
#define IGUANA_MAXCOINS 64
@ -337,7 +337,7 @@ struct iguana_spend256 { bits256 prevhash2; uint32_t sequenceid,scriptpos; int16
// permanent readonly structs
struct iguana_txid { bits256 txid; uint32_t txidind,firstvout,firstvin,locktime,version,timestamp,extraoffset; uint16_t numvouts,numvins; } __attribute__((packed));
struct iguana_unspent { uint64_t value; uint32_t txidind,pkind,prevunspentind,scriptpos; uint16_t fileid,scriptlen; uint16_t hdrsi:11,type:5; int16_t vout; } __attribute__((packed));
struct iguana_unspent { uint64_t value; uint32_t txidind,pkind,prevunspentind,scriptpos; uint16_t scriptlen,hdrsi; uint16_t fileid:11,type:5; int16_t vout; } __attribute__((packed));
struct iguana_spend { uint32_t spendtxidind,sequenceid,scriptpos; int16_t prevout; uint16_t fileid,scriptlen:15,external:1; } __attribute__((packed)); // numsigs:4,numpubkeys:4,p2sh:1,sighash:4

11
iguana/iguana_bundles.c

@ -808,11 +808,8 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp)
{
struct iguana_bundle *prevbp; int32_t i;
#ifdef IGUANA_SERIALIZE_SPENDVECTORGEN
//if ( coin->MAXMEM <= 4*(1024L * 1024 * 1024) )
{
if ( (prevbp= coin->current) != 0 && prevbp->hdrsi < (coin->longestchain / coin->chain->bundlesize)-0*coin->MAXBUNDLES )
return(0);
}
if ( (prevbp= coin->current) != 0 && prevbp->hdrsi < (coin->longestchain / coin->chain->bundlesize)-0*coin->MAXBUNDLES )
return(0);
#endif
for (i=0; i<bp->hdrsi; i++)
if ( (prevbp= coin->bundles[i]) == 0 || prevbp->emitfinish < coin->startutc
@ -821,7 +818,7 @@ int32_t iguana_bundlefinish(struct iguana_info *coin,struct iguana_bundle *bp)
#endif
)
break;
//printf("i.%d hdrsi.%d busy.%d helpers.%d\n",i,bp->hdrsi,coin->emitbusy,IGUANA_NUMHELPERS);
printf("i.%d hdrsi.%d busy.%d helpers.%d\n",i,bp->hdrsi,coin->emitbusy,IGUANA_NUMHELPERS);
if ( i == bp->hdrsi && coin->emitbusy < (IGUANA_NUMHELPERS/3) )
{
if ( bp->startutxo == 0 )
@ -872,7 +869,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
iguana_bundlehdr(coin,bp,starti);
else if ( bp->emitfinish != 0 )
{
//printf("ITER utxo.%u now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->utxofinish,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
printf("ITER utxo.%u now.%u spec.%-4d bundle.%-4d h.%-4d r.%-4d s.%-4d F.%d T.%d issued.%d mb.%d/%d\n",bp->utxofinish,(uint32_t)time(NULL),bp->numspec,bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->numrecv,bp->numsaved,bp->emitfinish,timelimit,counter,coin->MAXBUNDLES,coin->bundlescount);
if ( bp->utxofinish != 0 )
{
if ( bp->balancefinish == 0 )

8
iguana/iguana_unspents.c

@ -689,7 +689,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp)
printf("unexpected spendbp: height.%d bp.[%d] U%d <- S%d.[%d] [ext.%d %s prev.%d]\n",bp->bundleheight+i,spentbp->hdrsi,spent_unspentind,spendind,bp->hdrsi,s->external,bits256_str(str,prevhash),s->prevout);
errs++;
}
if ( 0 && now > spentbp->lastprefetch+1+5*coin->emitbusy )
if ( 1 && now > spentbp->lastprefetch+30 )
{
//printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch);
iguana_ramchain_prefetch(coin,ramchain);
@ -795,7 +795,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp,int3
for (i=0; i<bp->n; i++)
{
now = (uint32_t)time(NULL);
if ( 0 && now > bp->lastprefetch+1+5*coin->emitbusy )
if ( 1 && now > bp->lastprefetch+30 )
{
//printf("RT prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch);
iguana_ramchain_prefetch(coin,&bp->ramchain);
@ -927,7 +927,7 @@ int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct i
return(-1);
}
rdata = spentbp->ramchain.H.data;
if ( 0 && now > spentbp->lastprefetch+1+5*coin->emitbusy )
if ( 1 && now > spentbp->lastprefetch+30 )
{
//printf("RT prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch);
iguana_ramchain_prefetch(coin,&spentbp->ramchain);
@ -1474,7 +1474,7 @@ int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int
printf("GENERATE BALANCES ERROR ht.%d\n",bp->bundleheight);
exit(-1);
}
printf("GENERATED BALANCES for ht.%d duration %d seconds\n",bp->bundleheight,(uint32_t)time(NULL) - (uint32_t)starttime);
printf("GENERATED BALANCES for ht.%d duration %d seconds, (%d %d).%d\n",bp->bundleheight,(uint32_t)time(NULL) - (uint32_t)starttime,bp->hdrsi,coin->longestchain/coin->chain->bundlesize-1,bp->hdrsi >= coin->longestchain/coin->chain->bundlesize-1);
coin->balanceswritten++;
}
bp->balancefinish = (uint32_t)time(NULL);

Loading…
Cancel
Save