From 7d883ed2c5fe98903fa3e770f2affb5d51f0c0ad Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Apr 2016 14:41:14 -0600 Subject: [PATCH] test --- iguana/iguana777.c | 1 + iguana/iguana777.h | 2 +- iguana/iguana_unspents.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 5f53b8cfc..7db1f09a0 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -605,6 +605,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, mult = (strcmp("BTC",coin->symbol) != 0) ? 512 : 1; maxval = (strcmp("BTC",coin->symbol) != 0) ? 2048 : 256; coin->MAXMEM = juint(json,"RAM"); + coin->PREFETCHLAG = juint(json,"prefetchlag"); if ( (coin->MAXSTUCKTIME= juint(json,"maxstuck")) == 0 ) coin->MAXSTUCKTIME = _IGUANA_MAXSTUCKTIME; if ( coin->MAXMEM == 0 ) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index b0799a2d7..1346c5991 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -468,7 +468,7 @@ struct iguana_info char name[64],symbol[8],statusstr[512],scriptsfname[2][512]; 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; + int64_t mining,totalfees,TMPallocated,MAXRECVCACHE,MAXMEM,PREFETCHLAG,estsize,activebundles; 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; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 68c6330f2..f6ff8f186 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -710,7 +710,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp) } for (k=0; khdrsi,i,spendind); s = &S[spendind]; u = 0; @@ -724,7 +724,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 ( 1 && now > spentbp->lastprefetch+10 ) + if ( coin->PREFETCHLAG != 0 && now > spentbp->lastprefetch+coin->PREFETCHLAG ) { printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch); iguana_ramchain_prefetch(coin,&spentbp->ramchain);