Browse Source

Test

etomic
jl777 8 years ago
parent
commit
3acf2894c5
  1. 2
      iguana/exchanges/LP_ordermatch.c
  2. 5
      iguana/exchanges/LP_swap.c

2
iguana/exchanges/LP_ordermatch.c

@ -418,7 +418,7 @@ char *LP_connectedalice(cJSON *argjson) // alice
return(clonestr("{\"error\":\"no price set\"}")); return(clonestr("{\"error\":\"no price set\"}"));
} }
price = 1. / ask; price = 1. / ask;
if ( qprice > price+SMALLVAL ) //if ( qprice > price+SMALLVAL )
{ {
LP_availableset(autxo); LP_availableset(autxo);
return(clonestr("{\"error\":\"quote price too expensive\"}")); return(clonestr("{\"error\":\"quote price too expensive\"}"));

5
iguana/exchanges/LP_swap.c

@ -403,12 +403,13 @@ int32_t LP_waitfor(int32_t pairsock,struct basilisk_swap *swap,int32_t timeout,i
void *data; int32_t datalen,retval = -1; uint32_t expiration = (uint32_t)time(NULL) + timeout; void *data; int32_t datalen,retval = -1; uint32_t expiration = (uint32_t)time(NULL) + timeout;
while ( time(NULL) < expiration ) while ( time(NULL) < expiration )
{ {
//printf("start wait\n"); printf("start wait\n");
if ( (datalen= nn_recv(pairsock,&data,NN_MSG,0)) >= 0 ) if ( (datalen= nn_recv(pairsock,&data,NN_MSG,0)) >= 0 )
{ {
//printf("wait for got.%d\n",datalen); printf("wait for got.%d\n",datalen);
retval = (*verify)(swap,data,datalen); retval = (*verify)(swap,data,datalen);
nn_freemsg(data); nn_freemsg(data);
printf("retval.%d\n",retval);
return(retval); return(retval);
} else printf("error nn_recv\n"); } else printf("error nn_recv\n");
} }

Loading…
Cancel
Save