Skip to content

Commit

Permalink
Xcode 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jl777 authored and jl777 committed Feb 14, 2017
1 parent 86e49d7 commit da89efe
Show file tree
Hide file tree
Showing 67 changed files with 338 additions and 272 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,33 @@ iguana/confs/BTC_hdrs.txt
deprecated/.DS_Store

.DS_Store

*.pbxproj

iguana/tmp/.tmpmarker

iguana/SVM/rawfeatures/.tmpmarker

iguana/DB/.tmpmarker

iguana/DB/TRANSACTIONS/.tmpmarker

iguana/DB/purgeable/.tmpmarker

iguana/DB/purgeable/BTCD/.tmpmarker

iguana/DB/purgeable/BTC/.tmpmarker

iguana/DB/ECB/.tmpmarker

iguana/genesis/.tmpmarker

iguana/help/.tmpmarker

iguana/SVM/.tmpmarker

iguana/SVM/models/.tmpmarker

SuperNET.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist

SuperNET.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/SuperNET.xcscheme
7 changes: 4 additions & 3 deletions basilisk/basilisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
}
if ( s == n && valid == 1 && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) )
{
val = 0;
//fprintf(stderr,">>> (%s).%u ",addr->ipaddr,coin->chain->portp2p);
//printf("n.%d/fanout.%d i.%d l.%d [%s].tag%u send %s [%x] datalen.%d addr->supernet.%u basilisk.%u to (%s).%d destip.%s\n",n,fanout,i,l,cmd,*(uint32_t *)data,type,*(int32_t *)&data[datalen-4],datalen,addr->supernet,addr->basilisk,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast");
if ( encryptflag != 0 && bits256_nonz(addr->pubkey) != 0 )
Expand Down Expand Up @@ -462,7 +463,7 @@ char *basilisk_standardservice(char *CMD,struct supernet_info *myinfo,void *_add
}
ptr->finished = OS_milliseconds() + 10000;
}
if ( 0 && strcmp("MSG",CMD) == 0 )
if ( (0) && strcmp("MSG",CMD) == 0 )
printf("%s.(%s) -> (%s)\n",CMD,jprint(valsobj,0),retstr!=0?retstr:"");
return(retstr);
}
Expand Down Expand Up @@ -793,10 +794,10 @@ int32_t basilisk_p2pQ_process(struct supernet_info *myinfo,int32_t maxiters)
else
{
len += iguana_rwnum(0,ptr->data,sizeof(basilisktag),&basilisktag);
if ( 0 && myinfo->IAMLP == 0 )
if ( (0) && myinfo->IAMLP == 0 )
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,ptr->datalen,ptr->type,senderip,basilisktag);
basilisk_msgprocess(myinfo,ptr->addr,ptr->ipbits,ptr->type,basilisktag,&ptr->data[len],ptr->datalen - len);
if ( 0 && myinfo->IAMLP == 0 )
if ( (0) && myinfo->IAMLP == 0 )
printf("processed.%s from %s\n",ptr->type,senderip);
}
free(ptr);
Expand Down
2 changes: 1 addition & 1 deletion basilisk/basilisk_DEX.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ HASH_ARRAY_STRING(InstantDEX,request,hash,vals,hexstr)
} else printf("error creating request\n");
if ( datalen > 0 )
{
uint32_t msgid,crc,crcs[2],numiters = 0; uint8_t buf[4096];
uint32_t msgid,crc=0,crcs[2],numiters = 0; uint8_t buf[4096];
memset(hash.bytes,0,sizeof(hash));
msgid = (uint32_t)time(NULL);
DEX_channel = 'D' + ((uint32_t)'E' << 8) + ((uint32_t)'X' << 16);
Expand Down
2 changes: 1 addition & 1 deletion basilisk/basilisk_MSG.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ uint32_t basilisk_crcrecv(struct supernet_info *myinfo,int32_t width,uint8_t *ve

uint32_t basilisk_crcsend(struct supernet_info *myinfo,int32_t width,uint8_t *verifybuf,int32_t maxlen,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t crcs[2])
{
uint32_t crc; int32_t recvlen;
uint32_t crc; int32_t recvlen=0;
if ( crcs != 0 )
{
crc = calc_crc32(0,data,datalen);
Expand Down
2 changes: 1 addition & 1 deletion basilisk/basilisk_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int32_t basilisk_ping_genvirts(struct supernet_info *myinfo,uint8_t *data,int32_

int32_t basilisk_ping_processMSG(struct supernet_info *myinfo,uint32_t senderipbits,uint8_t *data,int32_t datalen)
{
int32_t i,msglen,len=0; uint8_t num,keylen,*message,*key; uint32_t duration;
int32_t i,msglen=0,len=0; uint8_t num,keylen,*message,*key; uint32_t duration;
if ( (num= data[len++]) > 0 )
{
//printf("processMSG num.%d datalen.%d\n",num,datalen);
Expand Down
4 changes: 4 additions & 0 deletions basilisk/basilisk_swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ int32_t basilisk_bobpayment_reclaim(struct supernet_info *myinfo,struct basilisk
int32_t basilisk_verify_bobpaid(struct supernet_info *myinfo,void *ptr,uint8_t *data,int32_t datalen)
{
uint8_t userdata[512]; int32_t i,retval,len = 0; bits256 revAm; struct basilisk_swap *swap = ptr;
memset(revAm.bytes,0,sizeof(revAm));
if ( basilisk_rawtx_spendscript(myinfo,swap,swap->bobcoin->blocks.hwmchain.height,&swap->bobpayment,0,data,datalen,0) == 0 )
{
for (i=0; i<32; i++)
Expand Down Expand Up @@ -838,6 +839,7 @@ int32_t basilisk_bobscripts_set(struct supernet_info *myinfo,struct basilisk_swa
int32_t basilisk_verify_privi(struct supernet_info *myinfo,void *ptr,uint8_t *data,int32_t datalen)
{
int32_t j,wrongfirstbyte,len = 0; bits256 privkey,pubi; char str[65],str2[65]; uint8_t secret160[20],pubkey33[33]; uint64_t txid; struct basilisk_swap *swap = ptr;
memset(privkey.bytes,0,sizeof(privkey));
if ( datalen == sizeof(bits256) )
{
for (j=0; j<32; j++)
Expand Down Expand Up @@ -902,6 +904,7 @@ uint32_t basilisk_swapsend(struct supernet_info *myinfo,struct basilisk_swap *sw
int32_t basilisk_priviextract(struct supernet_info *myinfo,struct iguana_info *coin,char *name,bits256 *destp,uint8_t secret160[20],bits256 srctxid,int32_t srcvout)
{
bits256 txid,privkey; char str[65]; int32_t i,vini,scriptlen; uint8_t rmd160[20],scriptsig[IGUANA_MAXSCRIPTSIZE];
memset(privkey.bytes,0,sizeof(privkey));
if ( (vini= iguana_vinifind(myinfo,coin,&txid,srctxid,srcvout)) >= 0 )
{
if ( (scriptlen= iguana_scriptsigextract(myinfo,coin,scriptsig,sizeof(scriptsig),txid,vini)) > 0 )
Expand Down Expand Up @@ -1327,6 +1330,7 @@ int32_t basilisk_verify_privkeys(struct supernet_info *myinfo,void *ptr,uint8_t
{
int32_t i,j,wrongfirstbyte=0,errs=0,len = 0; bits256 otherpriv,pubi; uint8_t secret160[20],otherpubkey[33]; uint64_t txid; struct basilisk_swap *swap = ptr;
//printf("verify privkeys choosei.%d otherchoosei.%d datalen.%d vs %d\n",swap->choosei,swap->otherchoosei,datalen,(int32_t)sizeof(swap->privkeys)+20+32);
memset(otherpriv.bytes,0,sizeof(otherpriv));
if ( swap->I.cutverified == 0 && swap->I.otherchoosei >= 0 && datalen == sizeof(swap->privkeys)+20+2*32 )
{
for (i=errs=0; i<sizeof(swap->privkeys)/sizeof(*swap->privkeys); i++)
Expand Down
1 change: 1 addition & 0 deletions basilisk/basilisk_tradebot.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ double basilisk_process_results(struct supernet_info *myinfo,struct basilisk_req
{
cJSON *array,*item; uint8_t *hexdata,*allocptr,hexspace[32768]; char *hexstr; int32_t i,hexlen,n,m,nonz; struct basilisk_request tmpR,R,refR,list[BASILISK_MAXRELAYS]; double metric=0.;
memset(&refR,0,sizeof(refR));
memset(&R,0,sizeof(R));
//printf("process.(%s)\n",jprint(retjson,0));
if ( (array= jarray(&n,retjson,"messages")) != 0 )
{
Expand Down
10 changes: 5 additions & 5 deletions basilisk/tradebots_SVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static inline double validate_ocas_model(register struct ocas_vars *vars,registe
{
register svmtype *features;
register double y,pred,perc,answer=0.,feature;
register int i,j,pos,neg,good,bad,oldcuts,training_errors,weekind,nonz,posA,negA;
register int i,j,pos,neg,good,bad,oldcuts,training_errors,weekind,nonz=0,posA,negA;
for (i=pos=neg=good=bad=oldcuts=training_errors=posA=negA=0; i<numdocs; i++)
{
weekind = (weekinds == 0) ? i : weekinds[i];
Expand Down Expand Up @@ -539,9 +539,9 @@ static inline void calc_ocas_strategy(register struct ocas_vars *vars,register i

static inline double ocas_splx_solver(register int *nonzalphap,register int maxlhs,register double *d,register double *activeH,register double *diag_H,register double *f,register double C,register double *alpha,register int n,register int MaxIter,register double TolAbs,register double TolRel,register double QP_TH)
{
register double *col_u,*col_v;
register double QP,QD,lastQD,tmp,diff,distA,distB,etaA,etaB,improv,tmp_num,delta,x_neq0,xval,dval,diagval,tmp_den,tau;
register int u=0,v=0,i,j,iter,nonzalpha,unlikely = 0;
register double *col_u=0,*col_v=0;
register double QP,QD,lastQD,tmp,diff,distA,distB,etaA,etaB,improv,tmp_num,delta,x_neq0,xval,dval,diagval=0.,tmp_den,tau=0.;
register int u=0,v=0,i,j,iter,nonzalpha=0,unlikely = 0;
QP = distA = distB = OCAS_PLUS_INF; lastQD = QD = OCAS_NEG_INF;
x_neq0 = C;
etaA = etaB = 0.;
Expand Down Expand Up @@ -838,7 +838,7 @@ static inline int ocas_iter(struct ocas_vars *vars,int max_nohwm)
int inactives[81];
register struct ocas_CLbuffers *ptr;
register double netcuts,startmilli,y,psum,pcount,nosum;
register int i,numfeatures,cutlen,lastanswerind,lwm,numactive,numthreads,answerind,*weekinds;
register int i,numfeatures,cutlen,lastanswerind,lwm=(1<<20),numactive,numthreads,answerind,*weekinds;
numactive = 0;
if ( (numfeatures= vars->numfeatures) > MAX_OCAS_FEATURES )
{
Expand Down
6 changes: 3 additions & 3 deletions basilisk/tradebots_liquidity.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ int32_t tradebots_calcpreds(float *RTpreds,struct tradebot_arbpair *pair,double
void tradebots_calcanswers(struct tradebot_arbpair *pair)
{
double highbid,lowask,futurebid,futureask,ave,vol,bidaves[TRADEBOTS_NUMDECAYS],askaves[TRADEBOTS_NUMDECAYS],bidslopes[TRADEBOTS_NUMDECAYS],askslopes[TRADEBOTS_NUMDECAYS];
float rawfeatures[sizeof(pair->rawfeatures)/sizeof(*pair->rawfeatures)],futuremin,futuremax,minval,maxval,*hblas = 0;
uint32_t timestamp,firsttime = 0; long fpos,savepos; int32_t flag,i,iter,j,ind,maxi;
float rawfeatures[sizeof(pair->rawfeatures)/sizeof(*pair->rawfeatures)],futuremin=0,futuremax=0,minval=0,maxval=0,*hblas = 0;
uint32_t timestamp,firsttime = 0; long fpos,savepos; int32_t flag,i,iter,j,ind,maxi=0;
OCAS_PLUS_INF = _OCAS_PLUS_INF; OCAS_NEG_INF = -_OCAS_PLUS_INF;
if ( pair->fp != 0 )
{
Expand Down Expand Up @@ -1143,7 +1143,7 @@ double tradebot_liquidity_active(struct supernet_info *myinfo,double *refpricep,

void tradebots_processprices(struct supernet_info *myinfo,struct exchange_info *exchange,char *base,char *rel,struct exchange_quote *bidasks,int32_t numbids,int32_t numasks)
{
double price,profitmargin,volume; struct tradebot_arbpair *pair;
double price,profitmargin=0.,volume; struct tradebot_arbpair *pair;
if ( strcmp(rel,"NXT") == 0 && strcmp(base,"BTC") != 0 && (base= NXT_assetnamefind(base)) == 0 )
{
//printf("reject %s %s/%s\n",exchange,base,rel);
Expand Down
2 changes: 1 addition & 1 deletion crypto777/OS_portable.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void OS_portable_randombytes(unsigned char *x,long xlen)
sleep(1);
continue;
}
if ( 0 )
if ( (0) )
{
int32_t j;
for (j=0; j<i; j++)
Expand Down
7 changes: 4 additions & 3 deletions crypto777/OS_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,16 +552,17 @@ uint32_t OS_conv_datenum(int32_t datenum,int32_t hour,int32_t minute,int32_t sec

int32_t OS_conv_unixtime(struct tai *tp,int32_t *secondsp,time_t timestamp) // gmtime -> datenum + number of seconds
{
struct tm tm,*ptr; int32_t datenum; uint32_t checktime; char buf[64]; struct tai t; struct taitime ct;
struct tai t; struct taitime ct;
if ( 1 )
{
*tp = t = utc2tai((uint32_t)timestamp);
ct = tai2time(t,0,0);
*secondsp = (ct.hour*3600 + ct.minute*60 + ct.second);
return(calc_datenum(ct.date.year,ct.date.month,ct.date.day));
}
else
/*else
{
struct tm tm,*ptr; int32_t datenum; uint32_t checktime; char buf[64];
if ( (ptr= gmtime(&timestamp)) != 0 )
tm = *ptr;;
strftime(buf,sizeof(buf), "%Y-%m-%dT%H:%M:%SZ",&tm); //printf("%s\n",buf);
Expand All @@ -572,7 +573,7 @@ int32_t OS_conv_unixtime(struct tai *tp,int32_t *secondsp,time_t timestamp) // g
return(-1);
}
return(datenum);
}
}*/
}

int32_t conv_date(int32_t *secondsp,char *date)
Expand Down
3 changes: 2 additions & 1 deletion crypto777/SaM.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ int32_t SaM_test()
memset(histo,0,sizeof(histo));
for (i=0; i<5; i++)
{
if ( 0 && (i % 100) == 99 )
if ( (0) && (i % 100) == 99 )
{
for (j=0; j<32; j++)
seed.bytes[j] = rand() >> 8;
Expand Down Expand Up @@ -340,6 +340,7 @@ bits384 SaM_encrypt(uint8_t *dest,uint8_t *src,int32_t len,bits384 password,uint
{
bits384 xorpad; int32_t i; struct SaM_info XORpad;
SaM_Initialize(&XORpad), SaM_Absorb(&XORpad,password.bytes,sizeof(password),(void *)&timestamp,sizeof(timestamp));
memset(xorpad.bytes,0,sizeof(xorpad));
while ( len >= 0 )
{
SaM_emit(&XORpad);
Expand Down
10 changes: 5 additions & 5 deletions crypto777/bitcoind_RPC.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *
else specialcase = 0;
if ( url[0] == 0 )
strcpy(url,"http://127.0.0.1:7776");
if ( specialcase != 0 && 0 )
if ( specialcase != 0 && (0) )
printf("<<<<<<<<<<< bitcoind_RPC: debug.(%s) url.(%s) command.(%s) params.(%s)\n",debugstr,url,command,params);
try_again:
if ( retstrp != 0 )
Expand Down Expand Up @@ -235,7 +235,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *
}
else
{
if ( 0 && specialcase != 0 )
if ( (0) && specialcase != 0 )
fprintf(stderr,"<<<<<<<<<<< bitcoind_RPC: BTCD.(%s) -> (%s)\n",params,s.ptr);
count2++;
elapsedsum2 += (OS_milliseconds() - starttime);
Expand All @@ -244,9 +244,9 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *
return(s.ptr);
}
}
printf("bitcoind_RPC: impossible case\n");
free(s.ptr);
return(0);
//printf("bitcoind_RPC: impossible case\n");
//free(s.ptr);
//return(0);
}

/************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion crypto777/iguana_OS.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ void OS_remove_directory(char *dirname)
void OS_ensure_directory(char *dirname)
{
FILE *fp; int32_t retval; char fname[512];
if ( 0 && OS_removefile(dirname,0) < 0 )
if ( (0) && OS_removefile(dirname,0) < 0 )
{
sprintf(fname,"tmp/%d",rand());
OS_renamefile(dirname,fname);
Expand Down
8 changes: 4 additions & 4 deletions crypto777/iguana_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void calc_OP_HASH160(char hexstr[41],uint8_t rmd160[20],char *pubkey)
}
decode_hex(buf,len,pubkey);
calc_rmd160_sha256(rmd160,buf,len);
if ( 0 )
if ( (0) )
{
int i;
for (i=0; i<20; i++)
Expand Down Expand Up @@ -436,9 +436,9 @@ char *clonestr(char *str)
if ( str == 0 || str[0] == 0 )
{
printf("warning cloning nullstr.%p\n",str);
#ifdef __APPLE__
while ( 1 ) sleep(1);
#endif
//#ifdef __APPLE__
// while ( 1 ) sleep(1);
//#endif
str = (char *)"<nullstr>";
}
clone = (char *)malloc(strlen(str)+16);
Expand Down
4 changes: 2 additions & 2 deletions crypto777/inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ uint64_t _calc_ipbits(char *ip_port)
port = parse_ipaddr(ipaddr,ip_port);
memset(&addr,0,sizeof(addr));
portable_pton(ip_port[0] == '[' ? AF_INET6 : AF_INET,ipaddr,&addr);
if ( 0 )
if ( (0) )
{
int i;
for (i=0; i<16; i++)
Expand Down Expand Up @@ -472,7 +472,7 @@ uint32_t conv_domainname(char *ipaddr,char *domain)
int32_t ipv4only = 1;
uint32_t ipbits;
struct sockaddr_in ss;
if ( 0 && conv_domain((struct sockaddr_storage *)&ss,(const char *)domain,ipv4only) == 0 )
if ( (0) && conv_domain((struct sockaddr_storage *)&ss,(const char *)domain,ipv4only) == 0 )
{
ipbits = *(uint32_t *)&ss.sin_addr;
expand_ipbits(ipaddr,ipbits);
Expand Down
2 changes: 1 addition & 1 deletion crypto777/ramcoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ int32_t ramcoder_compress(uint8_t *bits,int32_t maxlen,uint8_t *data,int32_t dat
if ( ramcoder_encoder(0,1,data,datalen,hp,0,&seed) < 0 )
return(-1);
numbits = hp->bitoffset;
if ( 0 )
if ( (0) )
{
void *malloc(size_t); void free(void *);
int32_t i,checklen; uint8_t *checkbuf;
Expand Down
23 changes: 13 additions & 10 deletions datachain/datachain.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,19 @@ void datachain_update_spend(struct supernet_info *myinfo,int32_t ordered,struct

int64_t datachain_update(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *coin,uint32_t timestamp,struct iguana_bundle *bp,uint8_t rmd160[20],int64_t crypto777_payment,uint8_t type,int32_t height,uint64_t hdrsi_unspentind,int64_t value,uint32_t fileid,uint64_t scriptpos,int32_t scriptlen,bits256 txid,int32_t vout)
{
return(0);
if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 )
if ( (0) )
{
crypto777_payment += value;
//printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value));
if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 )
{
crypto777_payment += value;
//printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value));
}
else if ( crypto777_payment != 0 && (type == IGUANA_SCRIPT_OPRETURN || type == IGUANA_SCRIPT_3of3 || type == IGUANA_SCRIPT_2of2 || type == IGUANA_SCRIPT_1of1) )
{
//printf("datachain_update opreturn\n");
iguana_opreturn(myinfo,ordered,coin,timestamp,bp,crypto777_payment,height,hdrsi_unspentind,value,fileid,scriptpos,scriptlen);
} else datachain_update_spend(myinfo,ordered,coin,timestamp,bp,height,txid,vout,rmd160,value);
return(crypto777_payment);
}
else if ( crypto777_payment != 0 && (type == IGUANA_SCRIPT_OPRETURN || type == IGUANA_SCRIPT_3of3 || type == IGUANA_SCRIPT_2of2 || type == IGUANA_SCRIPT_1of1) )
{
//printf("datachain_update opreturn\n");
iguana_opreturn(myinfo,ordered,coin,timestamp,bp,crypto777_payment,height,hdrsi_unspentind,value,fileid,scriptpos,scriptlen);
} else datachain_update_spend(myinfo,ordered,coin,timestamp,bp,height,txid,vout,rmd160,value);
return(crypto777_payment);
return(0);
}
4 changes: 2 additions & 2 deletions gecko/gecko.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void gecko_iteration(struct supernet_info *myinfo,struct iguana_info *btcd,struc
//iguana_update_balances(virt);
//iguana_realtime_update(myinfo,virt);
}
if ( 0 && hwmhdrsi <= longesthdrsi )//&& virt->blocks.hwmchain.height < virt->longestchain-1 )
if ( (0) && hwmhdrsi <= longesthdrsi )//&& virt->blocks.hwmchain.height < virt->longestchain-1 )
{
if ( time(NULL) > virt->hdrstime+3 )
{
Expand All @@ -62,7 +62,7 @@ void gecko_iteration(struct supernet_info *myinfo,struct iguana_info *btcd,struc
virt->hdrstime = (uint32_t)time(NULL);
}
}
if ( 0 && btcd->FULLNODE != 0 )//&& virt->blocks.hwmchain.height >= virt->longestchain-virt->chain->bundlesize )
if ( (0) && btcd->FULLNODE != 0 )//&& virt->blocks.hwmchain.height >= virt->longestchain-virt->chain->bundlesize )
{
bitcoin_address(mineraddr,virt->chain->pubtype,myinfo->persistent_pubkey33,33);
//fprintf(stderr,"mine.%s %s\n",virt->symbol,mineraddr);
Expand Down
2 changes: 1 addition & 1 deletion gecko/gecko_headers.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void gecko_blockhashupdate(struct iguana_info *virt,bits256 hash2,int32_t height

char *gecko_headersarrived(struct supernet_info *myinfo,struct iguana_info *virt,char *remoteaddr,uint8_t *data,int32_t datalen,bits256 firsthash2)
{
bits256 hash2,prevhash2; struct iguana_block *block; int32_t height,firstheight,i,len=0,n,num; struct iguana_msgzblock zmsgB; char str[65],str2[65];
bits256 hash2,prevhash2; struct iguana_block *block; int32_t height=0,firstheight,i,len=0,n,num; struct iguana_msgzblock zmsgB; char str[65],str2[65];
num = (int32_t)(datalen / 84);
printf("headers.%s arrived.%d from %s\n",virt->symbol,num,bits256_str(str,firsthash2));
if ( (block= iguana_blockfind("geckohdrs",virt,firsthash2)) != 0 && (firstheight= block->height) >= 0 )
Expand Down
2 changes: 1 addition & 1 deletion gecko/gecko_miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int32_t gecko_blocknonce_verify(struct iguana_info *virt,uint8_t *serialized,int

uint32_t gecko_nBits(struct iguana_info *virt,uint32_t *prevtimestampp,struct iguana_block *block,int32_t n)
{
uint32_t nBits = GECKO_DEFAULTDIFF,starttime,endtime,est; struct iguana_block *prev=0; int32_t i,diff; bits256 targetval;
uint32_t nBits = GECKO_DEFAULTDIFF,starttime=0,endtime=0,est; struct iguana_block *prev=0; int32_t i,diff; bits256 targetval;
*prevtimestampp = 0;
if ( virt->chain->estblocktime == 0 )
return(GECKO_EASIESTDIFF);
Expand Down
Loading

0 comments on commit da89efe

Please sign in to comment.