Browse Source

Test

etomic
jl777 8 years ago
parent
commit
aa694c6f09
  1. 1
      iguana/exchanges/LP_commands.c
  2. 9
      iguana/exchanges/LP_network.c

1
iguana/exchanges/LP_commands.c

@ -38,6 +38,7 @@ struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srch
void LP_command(struct LP_peerinfo *mypeer,int32_t pubsock,cJSON *argjson,uint8_t *data,int32_t datalen,double profitmargin)
{
char *method,*base,*rel,*retstr,*pairstr; cJSON *retjson; double price; bits256 srchash,desthash,pubkey,privkey,txid,desttxid; struct LP_utxoinfo *utxo; uint32_t timestamp,quotetime; int32_t destvout,DEXselector = 0; uint64_t txfee,satoshis,desttxfee,destsatoshis,value; struct basilisk_request R;
printf("LP_command.(%s)\n",jprint(argjson,0));
if ( (method= jstr(argjson,"method")) != 0 )
{
txid = jbits256(argjson,"txid");

9
iguana/exchanges/LP_network.c

@ -115,6 +115,13 @@ char *nanomsg_tcpname(char *str,char *ipaddr,uint16_t port)
int32_t LP_send(int32_t sock,char *msg,int32_t freeflag)
{
int32_t sentbytes,len,i; struct nn_pollfd pfd;
if ( sock < 0 )
{
printf("LP_send to illegal socket\n");
if ( freeflag != 0 )
free(msg);
return(-1);
}
for (i=0; i<100; i++)
{
pfd.fd = sock;
@ -132,6 +139,8 @@ int32_t LP_send(int32_t sock,char *msg,int32_t freeflag)
usleep(1000);
}
printf("error LP_send\n");
if ( freeflag != 0 )
free(msg);
return(-1);
}

Loading…
Cancel
Save