From 72dd7a41e9ccaa6196bb387e805ea6b2ce3b1f71 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Jan 2017 19:48:18 +0200 Subject: [PATCH] test --- gecko/gecko.c | 2 ++ iguana/iguana777.c | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gecko/gecko.c b/gecko/gecko.c index 5a0c2dbaa..a3186f5b8 100755 --- a/gecko/gecko.c +++ b/gecko/gecko.c @@ -180,6 +180,8 @@ struct iguana_info *basilisk_geckochain(struct supernet_info *myinfo,char *symbo virt->enableCACHE = 1; serialized = get_dataptr(BASILISK_HDROFFSET,&ptr,&datalen,hexbuf,sizeof(hexbuf),hexstr); iguana_chaininit(myinfo,virt->chain,1,valsobj); + if ( virt->FULLNODE >= 0 ) + virt->chain->userpass[0] = 0; virt->chain->isPoS = 1; hdrsize = (virt->chain->zcash != 0) ? sizeof(struct iguana_msgzblockhdr) : sizeof(struct iguana_msgblockhdr); if ( gecko_blocknonce_verify(virt,serialized,hdrsize,virt->chain->nBits,0,0) > 0 ) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index bde87f374..9f5647168 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -58,6 +58,8 @@ struct iguana_info *iguana_coinadd(char *symbol,char *name,cJSON *argjson,int32_ else { coin->chain = iguana_chainfind(myinfo,(char *)symbol,argjson,1); + if ( coin->FULLNODE >= 0 ) + coin->chain->userpass[0] = 0; coin->peers = calloc(1,sizeof(*coin->peers)); for (j=0; jactive = juint(json,"active"); if ( (coin->minconfirms= minconfirms) == 0 ) coin->minconfirms = (strcmp(symbol,"BTC") == 0) ? 3 : 10; - if ( coin->chain == 0 && (coin->chain= iguana_createchain(json)) == 0 ) - { - printf("cant initialize chain.(%s)\n",jstr(json,0)); - strcpy(coin->name,"illegalcoin"); - coin->symbol[0] = 0; - return(0); - } if ( jobj(json,"RELAY") != 0 ) coin->FULLNODE = jint(json,"RELAY"); else coin->FULLNODE = (strcmp(coin->symbol,"BTCD") == 0); @@ -1159,6 +1154,15 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, else coin->VALIDATENODE = (strcmp(coin->symbol,"BTCD") == 0); if ( coin->VALIDATENODE > 0 || coin->FULLNODE > 0 ) SuperNET_MYINFO(0)->IAMRELAY++; + if ( coin->chain == 0 && (coin->chain= iguana_createchain(json)) == 0 ) + { + printf("cant initialize chain.(%s)\n",jstr(json,0)); + strcpy(coin->name,"illegalcoin"); + if ( coin->FULLNODE >= 0 ) + coin->chain->userpass[0] = 0; + coin->symbol[0] = 0; + return(0); + } #ifdef __PNACL coin->VALIDATENODE = coin->FULLNODE = 0; #endif