Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
a61553bd83
  1. 5
      basilisk/basilisk.c

5
basilisk/basilisk.c

@ -174,7 +174,6 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
return(0); return(0);
} }
} }
printf("basilisk send -> (%s)\n",destipaddr);
iguana_rwnum(1,&data[-(int32_t)sizeof(*basilisktagp)],sizeof(*basilisktagp),basilisktagp); iguana_rwnum(1,&data[-(int32_t)sizeof(*basilisktagp)],sizeof(*basilisktagp),basilisktagp);
if ( *basilisktagp == 0 ) if ( *basilisktagp == 0 )
{ {
@ -186,18 +185,20 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
data -= sizeof(*basilisktagp), datalen += sizeof(*basilisktagp); data -= sizeof(*basilisktagp), datalen += sizeof(*basilisktagp);
memset(cmd,0,sizeof(cmd)); memset(cmd,0,sizeof(cmd));
sprintf(cmd,"SuperNET%s",type); sprintf(cmd,"SuperNET%s",type);
printf("basilisk send -> (%s)\n",destipaddr);
if ( destipaddr != 0 ) if ( destipaddr != 0 )
{ {
cmd[6] = 'E', cmd[7] = 'T'; cmd[6] = 'E', cmd[7] = 'T';
HASH_ITER(hh,myinfo->allcoins,coin,tmp) HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{ {
printf("basilisk iter.(%s) -> (%s)\n",coin->symbol,destipaddr);
if ( coin->peers == 0 ) if ( coin->peers == 0 )
continue; continue;
if ( (addr= iguana_peerslot(coin,calc_ipbits(destipaddr),0)) != 0 ) if ( (addr= iguana_peerslot(coin,calc_ipbits(destipaddr),0)) != 0 )
{ {
printf("RET [%d] to %s\n",datalen,addr->ipaddr); printf("RET [%d] to %s\n",datalen,addr->ipaddr);
return(iguana_queue_send(addr,delaymillis,&data[-(int32_t)sizeof(struct iguana_msghdr)],cmd,datalen)); return(iguana_queue_send(addr,delaymillis,&data[-(int32_t)sizeof(struct iguana_msghdr)],cmd,datalen));
} } else printf("cant find (%s) in (%s)\n",addr->ipaddr,coin->symbol);
} }
printf("cant find (%s) to RET to\n",addr->ipaddr); printf("cant find (%s) to RET to\n",addr->ipaddr);
return(-1); return(-1);

Loading…
Cancel
Save