From 8b2ba71d21f471234a9b53549e82e8b29d77079a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Apr 2016 16:20:11 -0500 Subject: [PATCH] test --- iguana/iguana777.c | 4 ++-- iguana/iguana777.h | 4 ++++ iguana/iguana_tx.c | 12 +++++++----- iguana/main.c | 8 ++++---- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 24ea249b8..816018afa 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -703,7 +703,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, // maxval = (int32_t)coin->MAXMEM; coin->MAXMEM *= (1024L * 1024 * 1024); #ifdef __PNACL__ - maxval = 1;// * (strcmp("BTC",coin->symbol) != 0) + 8; + //maxval = 1;// * (strcmp("BTC",coin->symbol) != 0) + 8; //if ( mult > 1 ) // mult /= 2; #endif @@ -731,7 +731,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, #ifdef __PNACL__ //coin->startPEND = coin->endPEND = 1; #endif - coin->enableCACHE = (strcmp("BTC",coin->symbol) != 0); + coin->enableCACHE = 0;//(strcmp("BTC",coin->symbol) != 0); if ( jobj(json,"cache") != 0 ) coin->enableCACHE = juint(json,"cache"); if ( (coin->polltimeout= juint(json,"poll")) <= 0 ) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index bdf1dec17..e5fa51010 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -50,7 +50,11 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_PENDINGREQUESTS 64 #define IGUANA_MINPENDBUNDLES 4 #define IGUANA_MAXPENDBUNDLES 64 +#ifdef __APPLE__ +#define IGUANA_RPCPORT 7779 +#else #define IGUANA_RPCPORT 7778 +#endif #define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16) #define IGUANA_MAPHASHTABLES 1 diff --git a/iguana/iguana_tx.c b/iguana/iguana_tx.c index 1e6524976..bbda108d7 100755 --- a/iguana/iguana_tx.c +++ b/iguana/iguana_tx.c @@ -24,20 +24,22 @@ int32_t iguana_scriptdata(struct iguana_info *coin,uint8_t *scriptspace,long fileptr[2],char *fname,uint64_t scriptpos,int32_t scriptlen) { - FILE *fp; int32_t retval = scriptlen; + FILE *fp; long err; int32_t retval = scriptlen; #ifndef __PNACL__ - if ( fileptr[0] == 0 ) + /*if ( fileptr[0] == 0 ) fileptr[0] = (uint64_t)OS_mapfile(fname,&fileptr[1],0); if ( fileptr[0] != 0 && (scriptpos + scriptlen) <= fileptr[1] ) memcpy(scriptspace,(void *)(fileptr[0] + scriptpos),scriptlen); - else + else*/ #endif if ( (fp= fopen(fname,"rb")) != 0 ) { fseek(fp,scriptpos,SEEK_SET); - if ( fread(scriptspace,1,scriptlen,fp) != scriptlen ) + if ( (err= fread(scriptspace,1,scriptlen,fp)) != scriptlen ) + { retval = -1; - //else printf("%s script[%d] offset.%d\n",fname,scriptlen,scriptpos); + printf("%s script[%d] offset.%d err.%ld\n",fname,scriptlen,scriptpos,err); + } fclose(fp); } else retval = -1; return(retval); diff --git a/iguana/main.c b/iguana/main.c index 840f4bb2e..6262da06b 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -68,12 +68,12 @@ int32_t HDRnet,netBLOCKS; cJSON *API_json; #ifdef __PNACL__ -char GLOBAL_TMPDIR[512] = "/DB/tmp"; +char GLOBAL_TMPDIR[512] = "/tmp"; char GLOBAL_DBDIR[512] = "/DB"; char GLOBAL_HELPDIR[512] = "/DB/help"; char GLOBAL_VALIDATEDIR[512] = "/DB/purgeable"; char GLOBAL_CONFSDIR[512] = "/DB/confs"; -int32_t IGUANA_NUMHELPERS = 1; +int32_t IGUANA_NUMHELPERS = 3; #else char GLOBAL_TMPDIR[512] = "tmp"; char GLOBAL_HELPDIR[512] = "help"; @@ -1139,7 +1139,7 @@ void iguana_appletests(struct supernet_info *myinfo) exit(-1); } sleep(1);*/ - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"prefetchlag\":13,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":500,\"endpend\":500,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"prefetchlag\":13,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":500,\"endpend\":500,\"services\":128,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":4,\"poll\":1}"),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 ) @@ -1327,7 +1327,7 @@ void iguana_main(void *arg) iguana_helpinit(myinfo); iguana_commandline(myinfo,arg); #ifdef __APPLE__ - //iguana_appletests(myinfo); + iguana_appletests(myinfo); #endif iguana_launchdaemons(myinfo); }