Browse Source

Test

etomic
jl777 8 years ago
parent
commit
6429226e73
  1. 5
      iguana/exchanges/LP_unspents.c

5
iguana/exchanges/LP_unspents.c

@ -54,6 +54,7 @@ int32_t LP_send(int32_t sock,char *msg,int32_t freeflag)
len = (int32_t)strlen(msg) + 1; len = (int32_t)strlen(msg) + 1;
if ( (sentbytes= nn_send(sock,msg,len,0)) != len ) if ( (sentbytes= nn_send(sock,msg,len,0)) != len )
printf("LP_send sent %d instead of %d\n",sentbytes,len); printf("LP_send sent %d instead of %d\n",sentbytes,len);
else printf("SENT.(%s)\n",msg);
if ( freeflag != 0 ) if ( freeflag != 0 )
free(msg); free(msg);
return(sentbytes); return(sentbytes);
@ -620,7 +621,7 @@ void LPinit(uint16_t myport,uint16_t mypull,uint16_t mypub,double profitmargin)
while ( peer->subsock >= 0 && (recvsize= nn_recv(peer->subsock,&ptr,NN_MSG,0)) >= 0 ) while ( peer->subsock >= 0 && (recvsize= nn_recv(peer->subsock,&ptr,NN_MSG,0)) >= 0 )
{ {
nonz++; nonz++;
printf("%s RECV.[%d] %s\n",peer->ipaddr,recvsize,ptr); printf("%s RECV.[%d] %s\n",peer->ipaddr,recvsize,(char *)ptr);
if ( ptr != 0 ) if ( ptr != 0 )
nn_freemsg(ptr), ptr = 0; nn_freemsg(ptr), ptr = 0;
} }
@ -628,7 +629,7 @@ void LPinit(uint16_t myport,uint16_t mypull,uint16_t mypub,double profitmargin)
while ( pullsock >= 0 && (recvsize= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 ) while ( pullsock >= 0 && (recvsize= nn_recv(pullsock,&ptr,NN_MSG,0)) >= 0 )
{ {
nonz++; nonz++;
printf("PULL.[%d] %s\n",recvsize,ptr); printf("PULL.[%d] %s\n",recvsize,(char *)ptr);
if ( ptr != 0 ) if ( ptr != 0 )
nn_freemsg(ptr), ptr = 0; nn_freemsg(ptr), ptr = 0;
} }

Loading…
Cancel
Save