Browse Source

test

etomic
jl777 8 years ago
parent
commit
8119d54626
  1. 4
      basilisk/basilisk_DEX.c
  2. 6
      iguana/dpow/dpow_network.c

4
basilisk/basilisk_DEX.c

@ -307,6 +307,8 @@ void basilisk_requests_poll(struct supernet_info *myinfo)
if ( bits256_cmp(myinfo->myaddr.persistent,issueR.srchash) == 0 ) // my request
{
dex_channelsend(myinfo,issueR.srchash,issueR.desthash,channel,0x4000000,(void *)&issueR.requestid,sizeof(issueR.requestid)); // 60
dpow_nanomsg_update(myinfo);
dex_updateclient(myinfo);
if ( (retstr= basilisk_start(myinfo,&issueR,1,issueR.optionhours * 3600)) != 0 )
free(retstr);
/*if ( (retstr= InstantDEX_accept(myinfo,0,0,0,issueR.requestid,issueR.quoteid)) != 0 )
@ -336,6 +338,8 @@ void basilisk_requests_poll(struct supernet_info *myinfo)
datalen = basilisk_rwDEXquote(1,data,&issueR);
msgid = (uint32_t)time(NULL);
dex_channelsend(myinfo,issueR.desthash,issueR.srchash,channel,msgid,data,datalen); //INSTANTDEX_LOCKTIME*2
dpow_nanomsg_update(myinfo);
dex_updateclient(myinfo);
if ( (retstr= basilisk_start(myinfo,&issueR,0,issueR.optionhours * 3600)) != 0 )
free(retstr);
/*crcs[0] = crcs[1] = 0;

6
iguana/dpow/dpow_network.c

@ -153,7 +153,7 @@ int32_t signed_nn_recv(void **freeptrp,void *ctx,uint8_t notaries[64][33],int32_
{
//for (i=0; i<recvbytes; i++)
// printf("%02x",((uint8_t *)sigpacket)[i]);
//printf(" <- RECV.%d\n",recvbytes);
printf(" <- RECV.%d\n",recvbytes);
}
if ( sigpacket != 0 && recvbytes > sizeof(*sigpacket) && sigpacket->packetlen == recvbytes-sizeof(*sigpacket) )
{
@ -905,7 +905,7 @@ int32_t dex_subsock_poll(struct supernet_info *myinfo)
int32_t size= -1; struct dex_nanomsghdr *dexp; void *freeptr;
if ( myinfo->subsock >= 0 && (size= signed_nn_recv(&freeptr,myinfo->ctx,myinfo->notaries,myinfo->numnotaries,myinfo->subsock,&dexp)) >= 0 )
{
//printf("SUBSOCK.%08x recv.%d datalen.%d\n",dexp->crc32,size,dexp->datalen);
printf("SUBSOCK.%08x recv.%d datalen.%d\n",dexp->crc32,size,dexp->datalen);
if ( dexp != 0 && dex_packetcheck(myinfo,dexp,size) == 0 )
{
//printf("SUBSOCK.%08x ",dexp->crc32);
@ -1775,7 +1775,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo)
signed_nn_send(myinfo->ctx,myinfo->persistent_priv,myinfo->pubsock,dexp,size);
dex_packet(myinfo,dexp,size);
}
//printf("GOT DEX bus PACKET.%d\n",size);
printf("GOT DEX bus PACKET.%d\n",size);
if ( freeptr != 0 )
nn_freemsg(freeptr), dexp = 0, freeptr = 0;
}

Loading…
Cancel
Save