From 344a1f4deb20c57dce488a7580d2bf1483ded680 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 20 Jul 2017 22:40:12 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_ordermatch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index c15ffa618..e74c93d45 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -440,13 +440,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 ( LP_myprice(&bid,&ask,Q.destcoin,Q.srccoin) <= SMALLVAL || (bid <= 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 ( (price= ask) == 0. ) + price = 1. / bid; if ( qprice > price+0.00000001 ) { printf("qprice %.8f too big vs %.8f\n",qprice,price);