From 43247b41767fe7c2d9a31177aa9a1fc58b2fe75b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 1 Jan 2017 15:00:59 +0200 Subject: [PATCH] fix getinfo --- iguana/iguana777.c | 41 +++++++++++++++++++++------------------ includes/iguana_structs.h | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 3b471900f..6176e51b7 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -872,12 +872,13 @@ void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin) memset(zero.bytes,0,sizeof(zero)); if ( (bp= iguana_bundlecreate(coin,&bundlei,0,*(bits256 *)coin->chain->genesis_hashdata,zero,1)) != 0 ) bp->bundleheight = 0; + coin->notarychain = -1; if ( coin->FULLNODE == 0 ) { - coin->notarychain = -1; for (i=0; isymbol,NOTARYCHAINS[i]) == 0 ) { + printf("SET NOTARYCHAIN.%d\n",i); coin->notarychain = i; break; } @@ -885,10 +886,7 @@ void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin) addr = &coin->peers->active[IGUANA_MAXPEERS-2]; iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(coin->seedipaddr)); printf("SEED_IPADDR initpeer.(%s) notarychain.%d\n",addr->ipaddr,coin->notarychain); - if ( coin->notarychain < 0 ) - { - iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); - } + iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); } void iguana_coinloop(void *arg) @@ -899,20 +897,6 @@ void iguana_coinloop(void *arg) coins++; coin = coins[0]; printf("begin coinloop[%d] %s\n",n,coin->symbol); - if ( myinfo->IAMNOTARY != 0 && (alladdresses= _dex_alladdresses(myinfo,coin->symbol)) != 0 ) - { - if ( (alljson= cJSON_Parse(alladdresses)) != 0 ) - { - if ( is_cJSON_Array(alljson) != 0 && (n= cJSON_GetArraySize(alljson)) > 0 ) - { - for (i=0; ididaddresses == 0 ) + { + coin->didaddresses = 1; + coin->notarychain = -1; + if ( myinfo->IAMNOTARY != 0 && (alladdresses= _dex_alladdresses(myinfo,coin->symbol)) != 0 ) + { + if ( (alljson= cJSON_Parse(alladdresses)) != 0 ) + { + if ( is_cJSON_Array(alljson) != 0 && (n= cJSON_GetArraySize(alljson)) > 0 ) + { + for (i=0; iFULLNODE < 0 || coin->notarychain >= 0 ) continue; /*if ( strcmp(coin->symbol,"RELAY") == 0 ) diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index 2d53fd9cc..6cf3766a3 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -517,7 +517,7 @@ struct iguana_info char lastdispstr[2048]; double txidfind_totalmillis,txidfind_num,spendtxid_totalmillis,spendtxid_num; struct iguana_monitorinfo monitoring[256]; - int32_t notarychain; + int32_t notarychain,didaddresses; struct datachain_info dPoW; struct iguana_zblock newblock; char *newblockstr; int32_t relay_RTheights[BASILISK_MAXRELAYS];