Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
21c980a855
  1. 2
      basilisk/basilisk.c
  2. 2
      iguana/iguana_msg.c
  3. 2
      iguana/iguana_peers.c

2
basilisk/basilisk.c

@ -139,6 +139,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
j = (r2 + k) % IGUANA_MAXCOINS; j = (r2 + k) % IGUANA_MAXCOINS;
if ( (coin= Coins[j]) == 0 ) if ( (coin= Coins[j]) == 0 )
continue; continue;
printf("check coin.%s\n",coin->symbol);
if ( coin->RELAYNODE == 0 && coin->VALIDATENODE == 0 ) if ( coin->RELAYNODE == 0 && coin->VALIDATENODE == 0 )
cmd[0] = 's'; cmd[0] = 's';
else cmd[0] = 'S'; else cmd[0] = 'S';
@ -150,6 +151,7 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
for (s=0; s<n; s++) for (s=0; s<n; s++)
if ( alreadysent[s] == addr->ipbits ) if ( alreadysent[s] == addr->ipbits )
break; break;
printf("%s s.%d vs n.%d\n",addr->ipaddr,s,n);
if ( s == n && addr->supernet != 0 && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) ) if ( s == n && addr->supernet != 0 && (destipaddr == 0 || strcmp(addr->ipaddr,destipaddr) == 0) )
{ {
printf("[%s] send %s.(%s) addr->supernet.%u to (%s).%d destip.%s\n",cmd,type,(char *)&data[4],addr->supernet,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast"); printf("[%s] send %s.(%s) addr->supernet.%u to (%s).%d destip.%s\n",cmd,type,(char *)&data[4],addr->supernet,addr->ipaddr,addr->A.port,destipaddr!=0?destipaddr:"broadcast");

2
iguana/iguana_msg.c

@ -266,7 +266,7 @@ void iguana_gotversion(struct iguana_info *coin,struct iguana_peer *addr,struct
else if ( 0 && addr->supernet == 0 && addr->basilisk == 0 )//|| (addr->basilisk != 0 && myinfo->IAMRELAY == 0) ) else if ( 0 && addr->supernet == 0 && addr->basilisk == 0 )//|| (addr->basilisk != 0 && myinfo->IAMRELAY == 0) )
addr->dead = (uint32_t)time(NULL); addr->dead = (uint32_t)time(NULL);
//if ( addr->supernet != 0 || addr->basilisk != 0 ) //if ( addr->supernet != 0 || addr->basilisk != 0 )
printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d basilisk.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet,addr->basilisk); // printf("height.%d nServices.%lld nonce.%llu %srelay node.(%s) supernet.%d basilisk.%d\n",vers->nStartingHeight,(long long)vers->nServices,(long long)vers->nonce,addr->relayflag==0?"non-":"",addr->ipaddr,addr->supernet,addr->basilisk);
if ( (int32_t)vers->nStartingHeight > coin->longestchain ) if ( (int32_t)vers->nStartingHeight > coin->longestchain )
{ {
if ( coin->badlongestchain != 0 && (int32_t)vers->nStartingHeight >= coin->badlongestchain ) if ( coin->badlongestchain != 0 && (int32_t)vers->nStartingHeight >= coin->badlongestchain )

2
iguana/iguana_peers.c

@ -678,7 +678,7 @@ void iguana_startconnection(void *arg)
n++; n++;
iguana_iAconnected(coin,addr); iguana_iAconnected(coin,addr);
coin->peers.numconnected++; coin->peers.numconnected++;
printf("%s.PEER CONNECTED.%d:%d of max.%d! %s:%d usock.%d\n",coin->symbol,coin->peers.numconnected,n,coin->MAXPEERS,addr->ipaddr,coin->chain->portp2p,addr->usock); //printf("%s.PEER CONNECTED.%d:%d of max.%d! %s:%d usock.%d\n",coin->symbol,coin->peers.numconnected,n,coin->MAXPEERS,addr->ipaddr,coin->chain->portp2p,addr->usock);
if ( strcmp("127.0.0.1",addr->ipaddr) == 0 ) if ( strcmp("127.0.0.1",addr->ipaddr) == 0 )
coin->peers.localaddr = addr; coin->peers.localaddr = addr;
else if ( coin->peers.numranked == 0 ) else if ( coin->peers.numranked == 0 )

Loading…
Cancel
Save