From 65d7bcc12c97d8a19ad1ee53d313a159874325f1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 6 Apr 2016 14:52:28 -0500 Subject: [PATCH] test --- README.md | 2 +- iguana/iguana777.c | 8 ++++---- iguana/iguana777.h | 1 + iguana/main.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 10ccb636a..886be86f4 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ > #TL;DR# > -> ```sudo apt-get update; sudo apt-get install build-essentials libcurl4-gnutls-dev autotools-dev autoconf libgmp3-dev libssl-dev libgmp3-dev; git clone https://github.com/jl777/SuperNET; cd SuperNET; ./m_onetime m_unix; ./m_unix; agents/iguana``` +> ```sudo apt-get update; sudo apt-get install build-essential libcurl4-gnutls-dev autotools-dev autoconf libgmp3-dev libssl-dev libgmp3-dev; git clone https://github.com/jl777/SuperNET; cd SuperNET; ./m_onetime m_unix; ./m_unix; agents/iguana``` > > The above one line gets SuperNET installed, built and launched for unix. > diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 67d0f3e95..0ce91fa03 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -607,9 +607,9 @@ void iguana_coinloop(void *arg) } if ( flag == 0 && coin->isRT == 0 ) usleep(coin->polltimeout*1000 + (coin->peers.numranked == 0)*1000000); - else if ( coin->RTheight >= coin->longestchain-3 ) - usleep(coin->polltimeout*1000 + coin->isRT*90000 + (coin->peers.numranked == 0)*1000000); - else usleep(25000); + else if ( coin->current != 0 && coin->current->hdrsi == coin->longestchain/coin->chain->bundlesize ) + usleep(coin->polltimeout*1000 + 90000 + (coin->peers.numranked == 0)*1000000); + else usleep(coin->polltimeout*1000); } } @@ -672,7 +672,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, if ( jobj(json,"cache") != 0 ) coin->enableCACHE = juint(json,"cache"); if ( (coin->polltimeout= juint(json,"poll")) <= 0 ) - coin->polltimeout = 10; + coin->polltimeout = IGUANA_DEFAULT_POLLTIMEOUT; coin->active = juint(json,"active"); if ( (coin->minconfirms = minconfirms) == 0 ) coin->minconfirms = (strcmp(symbol,"BTC") == 0) ? 3 : 10; diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 84324ff47..a9f49c1d2 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -31,6 +31,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_MAXCOINS 64 #define IGUANA_MAXDELAY_MILLIS (3600 * 1000) +#define IGUANA_DEFAULT_POLLTIMEOUT 10 #define IGUANA_EXCHANGEIDLE 10 #define IGUANS_JSMILLIS 100 diff --git a/iguana/main.c b/iguana/main.c index d5f7e9b57..cd14b8cbc 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1243,7 +1243,7 @@ void iguana_main(void *arg) if ( 1 ) { sleep(1); - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":256,\"endpend\":256,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"VALIDATE\":1,\"prefetchlag\":13,\"startpend\":256,\"endpend\":256,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":10}"),0,myinfo->rpcport)) != 0 ) { free(str); if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 )