|
|
@ -411,14 +411,14 @@ char *LP_connectedalice(cJSON *argjson) // alice |
|
|
|
printf("quote validate error %.0f\n",qprice); |
|
|
|
return(clonestr("{\"error\":\"quote validation error\"}")); |
|
|
|
} |
|
|
|
if ( (price= LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin)) <= SMALLVAL || bid <= SMALLVAL ) |
|
|
|
if ( (price= LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin)) <= SMALLVAL || ask <= SMALLVAL ) |
|
|
|
{ |
|
|
|
printf("this node has no price for %s/%s (%.8f %.8f)\n",Q.destcoin,Q.srccoin,bid,ask); |
|
|
|
LP_availableset(autxo); |
|
|
|
return(clonestr("{\"error\":\"no price set\"}")); |
|
|
|
} |
|
|
|
price = 1. / bid; |
|
|
|
if ( qprice > price ) |
|
|
|
price = 1. / ask; |
|
|
|
if ( qprice > price+SMALLVAL ) |
|
|
|
{ |
|
|
|
LP_availableset(autxo); |
|
|
|
return(clonestr("{\"error\":\"quote price too expensive\"}")); |
|
|
@ -476,7 +476,7 @@ int32_t LP_tradecommand(char *myipaddr,int32_t pubsock,cJSON *argjson,uint8_t *d |
|
|
|
printf("quote validate error %.0f\n",qprice); |
|
|
|
return(-4); |
|
|
|
} |
|
|
|
if ( qprice < price ) |
|
|
|
if ( qprice < price-SMALLVAL ) |
|
|
|
{ |
|
|
|
printf("(%.8f %.8f) quote price %.8f too low vs %.8f for %s/%s\n",bid,ask,qprice,price,Q.srccoin,Q.destcoin); |
|
|
|
return(-5); |
|
|
|