Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e2d32c2068
  1. 2
      iguana/iguana777.h
  2. 2
      iguana/iguana_bundles.c
  3. 1
      iguana/iguana_init.c
  4. 4
      iguana/iguana_recv.c
  5. 5
      iguana/iguana_unspents.c

2
iguana/iguana777.h

@ -469,7 +469,7 @@ struct iguana_info
struct iguana_peers peers; struct iguana_peer internaladdr;
uint64_t instance_nonce,myservices,totalsize,totalrecv,totalpackets,sleeptime;
int64_t mining,totalfees,TMPallocated,MAXRECVCACHE,MAXMEM,estsize,activebundles;
int32_t MAXPEERS,MAXPENDINGREQUESTS,MAXBUNDLES,MAXSTUCKTIME,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,balanceswritten,RTheight; bits256 balancehash;
int32_t MAXPEERS,MAXPENDINGREQUESTS,MAXBUNDLES,MAXSTUCKTIME,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,origbalanceswritten,balanceswritten,RTheight; bits256 balancehash;
uint32_t lastsync,parsetime,numiAddrs,lastpossible,bundlescount,savedblocks,backlog;
int32_t longestchain,badlongestchain,longestchain_strange,RTramchain_busy,emitbusy,stuckiters;
struct tai starttime; double startmillis;

2
iguana/iguana_bundles.c

@ -599,7 +599,7 @@ int32_t iguana_bundlehdr(struct iguana_info *coin,struct iguana_bundle *bp,int32
int32_t counter=0;
if ( 0 && bp->isRT == 0 && (bp->hdrsi == coin->bundlescount-1 || bp == coin->current) )
printf("hdr ITERATE.%d bundle.%d vs %d: h.%d n.%d r.%d s.%d c.%d finished.%d spec.%p[%d]\n",bp->hdrsi,bp->bundleheight,coin->longestchain-coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->numcached,bp->emitfinish,bp->speculative,bp->numspec);
if ( bp->hdrsi == coin->bundlescount-1 || (coin->enableCACHE != 0 && bp->numhashes < bp->n && (bp->speculative == 0 || bp->hdrsi >= coin->longestchain/bp->n)) )
if ( bp->hdrsi >= coin->bundlescount-2 || (coin->enableCACHE != 0 && bp->numhashes < bp->n && (bp->speculative == 0 || bp->hdrsi >= coin->longestchain/bp->n)) )
{
char str[64];
//printf("hdrs.%s\n",bits256_str(str,bp->hashes[0]));

1
iguana/iguana_init.c

@ -319,6 +319,7 @@ void iguana_parseline(struct iguana_info *coin,int32_t iter,FILE *fp)
}
printf("iguana_bundleQ\n");
}
coin->origbalanceswritten = coin->balanceswritten;
}
}

4
iguana/iguana_recv.c

@ -587,7 +587,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in
{
if ( bp == 0 )
return;
if ( bp->numhashes < bp->n && bundlei == 0 && bp->speculative == 0 && bp->bundleheight < coin->longestchain-coin->chain->bundlesize )
if ( coin->enableCACHE != 0 && bp->numhashes < bp->n && bundlei == 0 && bp->speculative == 0 && bp->bundleheight < coin->longestchain-coin->chain->bundlesize )
{
char str[65]; bits256_str(str,bp->hashes[0]);
fprintf(stderr,"Afound block -> %d %d hdr.%s\n",bp->bundleheight,coin->longestchain-coin->chain->bundlesize,str);
@ -849,7 +849,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
}
else if ( bp->hdrsi == coin->bundlescount-1 )
iguana_checklongestchain(coin,bp,num);
if ( (bp->speculative == 0 || num > bp->numspec) && bp->emitfinish == 0 )
if ( coin->enableCACHE != 0 && (bp->speculative == 0 || num > bp->numspec) && bp->emitfinish == 0 )
{
//printf("FOUND speculative.%s BLOCKHASHES[%d] ht.%d\n",bits256_str(str,blockhashes[1]),num,bp->bundleheight);
if ( bp->speculative == 0 )

5
iguana/iguana_unspents.c

@ -1350,11 +1350,10 @@ int32_t iguana_realtime_update(struct iguana_info *coin)
int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi,int32_t purgedist)
{
int32_t hdrsi,numpkinds,iter,numhdrsi,numunspents,err,origcount; struct iguana_bundle *bp;
int32_t hdrsi,numpkinds,iter,numhdrsi,numunspents,err; struct iguana_bundle *bp;
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);
origcount = coin->balanceswritten;
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;
@ -1466,7 +1465,7 @@ int32_t iguana_balanceflush(struct iguana_info *coin,int32_t refhdrsi,int32_t pu
printf("error mapping bundle.[%d]\n",hdrsi);
}
char str[65]; printf("BALANCES WRITTEN for %d/%d bundles %s\n",coin->balanceswritten,origcount,bits256_str(str,coin->balancehash));
if ( strcmp(coin->symbol,"BTC") == 0 && coin->balanceswritten > origcount+10 )
if ( strcmp(coin->symbol,"BTC") == 0 && coin->balanceswritten > coin->balanceswritten+10 )
{
int32_t i;
coin->active = 0;

Loading…
Cancel
Save