Browse Source

test

release/v0.1
jl777 8 years ago
parent
commit
ebcc061d76
  1. 18
      basilisk/basilisk.c
  2. 2
      iguana/iguana_peers.c

18
basilisk/basilisk.c

@ -171,7 +171,6 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
return(0);
}
}
alreadysent = calloc(IGUANA_MAXPEERS * IGUANA_MAXCOINS,sizeof(*alreadysent));
iguana_rwnum(1,&data[-(int32_t)sizeof(*basilisktagp)],sizeof(*basilisktagp),basilisktagp);
if ( *basilisktagp == 0 )
{
@ -183,7 +182,24 @@ int32_t basilisk_sendcmd(struct supernet_info *myinfo,char *destipaddr,char *typ
data -= sizeof(*basilisktagp), datalen += sizeof(*basilisktagp);
memset(cmd,0,sizeof(cmd));
sprintf(cmd,"SuperNET%s",type);
if ( destipaddr != 0 )
{
cmd[6] = 'E', cmd[7] = 'T';
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->peers == 0 )
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("cant find (%s) to RET to\n",addr->ipaddr);
return(-1);
}
//portable_mutex_lock(&myinfo->allcoins_mutex);
alreadysent = calloc(IGUANA_MAXPEERS * IGUANA_MAXCOINS,sizeof(*alreadysent));
HASH_ITER(hh,myinfo->allcoins,coin,tmp)
{
if ( coin->peers == 0 )

2
iguana/iguana_peers.c

@ -481,7 +481,7 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s
}
else if ( addr->msgcounts.verack == 0 && (strcmp(cmdstr,"version") != 0 && strcmp(cmdstr,"ConnectTo") != 0 && strcmp(cmdstr,"verack") != 0) != 0 )
{
printf("skip.(%s) since no verack yet\n",cmdstr);
//printf("skip.(%s) since no verack yet\n",cmdstr);
return(-1);
}
//printf("%s -> %s\n",cmdstr,addr->ipaddr);

Loading…
Cancel
Save