Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
b8caa6c467
  1. 4
      basilisk/basilisk.c
  2. 2
      iguana/iguana_peers.c
  3. 12
      iguana/iguana_wallet.c

4
basilisk/basilisk.c

@ -191,8 +191,8 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
continue;
if ( (addr= iguana_peerslot(coin,calc_ipbits(destipaddr),0)) != 0 )
{
printf("RET [%d] to %s\n",datalen,addr->ipaddr);
return(iguana_queue_send(addr,delaymillis,&data[-(int32_t)sizeof(struct iguana_msghdr)],cmd,datalen));
printf("RET [%d] to %s\n",datalen,addr->ipaddr);
return(iguana_queue_send(addr,delaymillis,&data[-(int32_t)sizeof(struct iguana_msghdr)],cmd,datalen));
}
}
printf("cant find (%s) to RET to\n",addr->ipaddr);

2
iguana/iguana_peers.c

@ -517,7 +517,7 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
}
}
addr->totalsent += len;
if ( addr->msgcounts.verack == 0 )
if ( 0 && addr->msgcounts.verack == 0 )
printf("verack.%d (%s) sent.%d bytes to %s\n",addr->msgcounts.verack,cmdstr,len,addr->ipaddr);
return(len);
}

12
iguana/iguana_wallet.c

@ -1098,7 +1098,7 @@ double _max100(double val)
cJSON *iguana_getinfo(struct supernet_info *myinfo,struct iguana_info *coin)
{
cJSON *retjson = cJSON_CreateObject();
int32_t i; struct iguana_peer *addr; cJSON *array,*retjson = cJSON_CreateObject();
if ( coin != 0 )
{
jaddstr(retjson,"result","success");
@ -1118,7 +1118,17 @@ cJSON *iguana_getinfo(struct supernet_info *myinfo,struct iguana_info *coin)
jaddnum(retjson,"longestchain",coin->longestchain);
jaddnum(retjson,"port",coin->chain->portp2p);
if ( coin->peers != 0 )
{
array = cJSON_CreateArray();
for (i=0; i<IGUANA_MAXPEERS; i++)
{
addr = &coin->peers->active[i];
if ( addr->usock >= 0 && addr->supernet != 0 && addr->ipaddr[0] != 0 )
jaddistr(array,addr->ipaddr);
}
jadd(retjson,"supernet",array);
jaddnum(retjson,"connections",coin->peers->numranked);
}
jaddnum(retjson,"difficulty",coin->blocks.hwmchain.PoW);
jaddstr(retjson,"status",coin->statusstr);
jaddstr(retjson,"coin",coin->symbol);

Loading…
Cancel
Save