jl777 8 years ago
parent
commit
df83817f10
  1. 15
      basilisk/basilisk.c
  2. 6
      basilisk/basilisk_CMD.c
  3. 2
      basilisk/basilisk_bitcoin.c
  4. 7
      iguana/iguana_msg.c

15
basilisk/basilisk.c

@ -840,7 +840,7 @@ void basilisk_requests_poll(struct supernet_info *myinfo)
void basilisks_loop(void *arg)
{
struct iguana_info *virt,*tmpcoin,*coin,*btcd; struct basilisk_message *msg,*tmpmsg; struct basilisk_item *tmp,*pending; uint32_t now; int32_t iter,maxmillis,flag=0; struct supernet_info *myinfo = arg;
struct iguana_info *virt,*tmpcoin,*coin,*notary; struct basilisk_message *msg,*tmpmsg; struct basilisk_item *tmp,*pending; uint32_t now; int32_t iter,maxmillis,flag=0; struct supernet_info *myinfo = arg;
iter = 0;
while ( 1 )
{
@ -856,7 +856,7 @@ void basilisks_loop(void *arg)
}
}
portable_mutex_unlock(&myinfo->basilisk_mutex);
if ( (btcd= iguana_coinfind("BTCD")) != 0 )
if ( (notary= iguana_coinfind("NOTARY")) != 0 && myinfo->NOTARY.RELAYID >= 0 )
{
maxmillis = (1000 / (myinfo->allcoins_numvirts + 1)) + 1;
//portable_mutex_lock(&myinfo->allcoins_mutex);
@ -864,14 +864,11 @@ void basilisks_loop(void *arg)
{
if ( virt->started != 0 && virt->active != 0 && virt->virtualchain != 0 )
{
gecko_iteration(myinfo,btcd,virt,maxmillis), flag++;
gecko_iteration(myinfo,notary,virt,maxmillis), flag++;
}
}
//portable_mutex_unlock(&myinfo->allcoins_mutex);
if ( myinfo->NOTARY.RELAYID >= 0 )
{
basilisk_ping_send(myinfo,btcd);
}
basilisk_ping_send(myinfo,notary);
}
if ( myinfo->expiration != 0 )
{
@ -885,9 +882,9 @@ void basilisks_loop(void *arg)
//printf(">>>>>>>>>>>>> update %s finished\n",coin->symbol);
}
}
if ( myinfo->NOTARY.RELAYID < 0 )
basilisk_requests_poll(myinfo);
}
if ( myinfo->NOTARY.RELAYID < 0 && myinfo->expiration != 0 )
basilisk_requests_poll(myinfo);
now = (uint32_t)time(NULL);
portable_mutex_lock(&myinfo->messagemutex);
HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg)

6
basilisk/basilisk_CMD.c

@ -218,7 +218,7 @@ char *basilisk_respond_value(struct supernet_info *myinfo,char *CMD,void *addr,c
{
retstr = ptr->retstr;
ptr->finished = (uint32_t)time(NULL);
} else retstr = clonestr("{\"error\":\"no coin specified or error bitcoinrawtx\"}");
} else retstr = clonestr("{\"error\":\"no coin specified or error bitcoin value\"}");
return(retstr);
}
@ -232,7 +232,7 @@ char *basilisk_respond_balances(struct supernet_info *myinfo,char *CMD,void *add
{
retstr = ptr->retstr;
ptr->finished = (uint32_t)time(NULL);
} else retstr = clonestr("{\"error\":\"no coin specified or error bitcoinrawtx\"}");
} else retstr = clonestr("{\"error\":\"no coin specified or error bitcoin balances\"}");
return(retstr);
}
@ -247,7 +247,7 @@ char *basilisk_respond_getinfo(struct supernet_info *myinfo,char *CMD,void *addr
{
retstr = ptr->retstr;
ptr->finished = (uint32_t)time(NULL);
} else retstr = clonestr("{\"error\":\"no coin specified or error bitcoinrawtx\"}");
} else retstr = clonestr("{\"error\":\"no coin specified or error bitcoin getinfo\"}");
return(retstr);
}

2
basilisk/basilisk_bitcoin.c

@ -424,7 +424,7 @@ void *basilisk_bitcoinvalue(struct basilisk_item *Lptr,struct supernet_info *myi
void *basilisk_getinfo(struct basilisk_item *Lptr,struct supernet_info *myinfo,struct iguana_info *coin,char *remoteaddr,uint32_t basilisktag,int32_t timeoutmillis,cJSON *valsobj)
{
struct basilisk_item *ptr; cJSON *infojson; int32_t numsent,fanout,numrequired;
if ( myinfo->IAMNOTARY != 0 || myinfo->NOTARY.RELAYID >= 0 )
if ( (myinfo->IAMNOTARY != 0 || myinfo->NOTARY.RELAYID >= 0) && strcmp(coin->symbol,"NOTARY") != 0 )
return(0);
if ( coin->VALIDATENODE != 0 || coin->FULLNODE != 0 )
{

7
iguana/iguana_msg.c

@ -474,8 +474,11 @@ int32_t iguana_send_ping(struct supernet_info *myinfo,struct iguana_info *coin,s
int32_t len; uint64_t nonce; uint8_t serialized[sizeof(struct iguana_msghdr) + sizeof(nonce)];
if ( addr->msgcounts.verack == 0 )
{
printf("%s send version instead of ping to %s\n",coin->symbol,addr->ipaddr);
return(iguana_send_version(coin,addr,coin->myservices));
if ( strcmp(addr->ipaddr,myinfo->ipaddr) != 0 )
{
printf("%s send version instead of ping to %s\n",coin->symbol,addr->ipaddr);
return(iguana_send_version(coin,addr,coin->myservices));
}
}
if ( (nonce= addr->pingnonce) == 0 )
{

Loading…
Cancel
Save