jl777 8 years ago
parent
commit
158dcd7ec4
  1. 12
      basilisk/basilisk.c
  2. 8
      basilisk/basilisk_ping.c

12
basilisk/basilisk.c

@ -821,23 +821,23 @@ int32_t basilisk_p2pQ_process(struct supernet_info *myinfo,int32_t maxiters)
{
len = 0;
expand_ipbits(senderip,ptr->ipbits);
printf("p2p.%d from.(%s) %c%c%c datalen.%d\n",n,senderip,ptr->type[0],ptr->type[1],ptr->type[2],ptr->datalen);
//printf("p2p.%d from.(%s) %c%c%c datalen.%d\n",n,senderip,ptr->type[0],ptr->type[1],ptr->type[2],ptr->datalen);
if ( ptr->type[0] == 'P' && ptr->type[1] == 'I' && ptr->type[2] == 'N' )
{
if ( myinfo->NOTARY.RELAYID >= 0 )
{
printf("process ping\n");
//printf("process ping\n");
basilisk_ping_process(myinfo,ptr->addr,ptr->ipbits,ptr->data,ptr->datalen);
printf("done process ping\n");
//printf("done process ping\n");
}
}
else
{
len += iguana_rwnum(0,ptr->data,sizeof(basilisktag),&basilisktag);
//if ( 0 && myinfo->IAMLP == 0 )
if ( 0 && myinfo->IAMLP == 0 )
printf("RELAYID.%d ->received.%d basilisk_p2p.(%s) from %s tag.%u\n",myinfo->NOTARY.RELAYID,ptr->datalen,ptr->type,senderip,basilisktag);
basilisk_msgprocess(myinfo,ptr->addr,ptr->ipbits,ptr->type,basilisktag,&ptr->data[len],ptr->datalen - len);
//if ( 0 && myinfo->IAMLP == 0 )
if ( 0 && myinfo->IAMLP == 0 )
printf("processed.%s from %s\n",ptr->type,senderip);
}
free(ptr);
@ -931,7 +931,7 @@ void basilisks_loop(void *arg)
else if ( myinfo->IAMLP != 0 )
endmilli = startmilli + 1000;
else endmilli = startmilli + 2000;
printf("endmilli %f vs now %f\n",endmilli,OS_milliseconds());
//printf("endmilli %f vs now %f\n",endmilli,OS_milliseconds());
while ( OS_milliseconds() < endmilli )
usleep(10000);
iter++;

8
basilisk/basilisk_ping.c

@ -249,7 +249,7 @@ void basilisk_ping_process(struct supernet_info *myinfo,struct iguana_peer *addr
//else printf("\n");
//for (i=0; i<datalen; i++)
// printf("%02x",data[i]);
printf("<<<<<<<<<<< input ping from.(%s) rel.%d numrelays.%d datalen.%d relay.%d Q.%d\n",ipbuf,basilisk_relayid(myinfo,(uint32_t)calc_ipbits(ipbuf)),numrelays,datalen,myinfo->NOTARY.RELAYID,QUEUEITEMS);
//printf("<<<<<<<<<<< input ping from.(%s) rel.%d numrelays.%d datalen.%d relay.%d Q.%d\n",ipbuf,basilisk_relayid(myinfo,(uint32_t)calc_ipbits(ipbuf)),numrelays,datalen,myinfo->NOTARY.RELAYID,QUEUEITEMS);
//basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits(ipbuf),GENESIS_PUBKEY);
}
@ -262,9 +262,9 @@ int32_t basilisk_ping_gen(struct supernet_info *myinfo,uint8_t *data,int32_t max
datalen += basilisk_ping_genrelay(myinfo,&data[datalen],maxlen - datalen,&myinfo->NOTARY.RELAYS[i]);
//datalen += basilisk_ping_genDEX(myinfo,&data[datalen],maxlen - datalen);
datalen += basilisk_ping_genMSG(myinfo,&data[datalen],maxlen - datalen);
for (i=0; i<datalen; i++)
printf("%02x",data[i]);
printf("output ping datalen.%d relay.%d >>>>>>>>>> Q.%d\n",datalen,myinfo->NOTARY.RELAYID,QUEUEITEMS);
//for (i=0; i<datalen; i++)
// printf("%02x",data[i]);
//printf(" output ping datalen.%d relay.%d >>>>>>>>>> Q.%d\n",datalen,myinfo->NOTARY.RELAYID,QUEUEITEMS);
return(datalen);
}

Loading…
Cancel
Save