Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
d4adc6c3be
  1. 2
      iguana/iguana777.c
  2. 4
      iguana/iguana777.h
  3. 4
      iguana/iguana_bundles.c
  4. 2
      iguana/main.c

2
iguana/iguana777.c

@ -551,6 +551,8 @@ 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 : 64;
coin->MAXMEM = juint(json,"RAM");
if ( (coin->MAXSTUCKTIME= juint(json,"maxstuck")) == 0 )
coin->MAXSTUCKTIME = _IGUANA_MAXSTUCKTIME;
if ( coin->MAXMEM == 0 )
coin->MAXMEM = IGUANA_DEFAULTRAM;
if ( strcmp("BTC",coin->symbol) == 0 && coin->MAXMEM <= 4 )

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 77
#define IGUANA_MAXCOINS 64
#define IGUANA_MAXDELAY_MILLIS (3600 * 1000)
@ -463,7 +463,7 @@ struct iguana_info
struct iguana_peers peers;
uint64_t instance_nonce,myservices,totalsize,totalrecv,totalpackets,sleeptime;
int64_t mining,totalfees,TMPallocated,MAXRECVCACHE,MAXMEM,estsize,activebundles;
int32_t MAXPEERS,MAXPENDING,MAXBUNDLES,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,balanceswritten,RTheight; bits256 balancehash;
int32_t MAXPEERS,MAXPENDING,MAXBUNDLES,MAXSTUCKTIME,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,balanceswritten,RTheight; bits256 balancehash;
uint32_t lastsync,parsetime,numiAddrs,lastpossible,bundlescount,savedblocks,backlog;
int32_t longestchain,badlongestchain,longestchain_strange,RTramchain_busy,emitbusy;
struct tai starttime; double startmillis;

4
iguana/iguana_bundles.c

@ -928,9 +928,9 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct OS_memspace *mem,stru
if ( coin->stucktime != 0 )
{
lag = time(NULL)-coin->stucktime;
if ( lag == IGUANA_MAXSTUCKTIME/2 || lag == 3*IGUANA_MAXSTUCKTIME/4 )
if ( lag == coin->MAXSTUCKTIME/2 || lag == 3*coin->MAXSTUCKTIME/4 )
{
if ( lag > IGUANA_MAXSTUCKTIME/2 )
if ( lag > coin->MAXSTUCKTIME/2 )
{
struct iguana_blockreq *breq;
while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 )

2
iguana/main.c

@ -373,7 +373,7 @@ void mainloop(struct supernet_info *myinfo)
}
myfree(ptr,ptr->allocsize);
}
if ( coin->stucktime != 0 && coin->isRT == 0 && coin->RTheight == 0 && (time(NULL) - coin->stucktime) > IGUANA_MAXSTUCKTIME )
if ( coin->stucktime != 0 && coin->isRT == 0 && coin->RTheight == 0 && (time(NULL) - coin->stucktime) > coin->MAXSTUCKTIME )
{
printf("%s is stuck too long, restarting\n",coin->symbol);
iguana_coinpurge(coin);

Loading…
Cancel
Save