From 8ac57c2d15de2f5c1888fddf5476845c76af91bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Jun 2017 10:55:27 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_prices.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index b18794fe7..6f202c070 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -289,8 +289,9 @@ static int _cmp_orderbookrev(const void *a,const void *b) cJSON *LP_orderbookjson(struct LP_cacheinfo *ptr,int32_t polarity) { double price; cJSON *item = cJSON_CreateObject(); - if ( (price= ptr->price) != 0. ) + if ( ptr->Q.satoshis != 0 && ptr->Q.destsatoshis != 0 ) { + price = (double)ptr->Q.destsatoshis / ptr->Q.satoshis; jaddnum(item,"price",polarity > 0 ? price : 1. / price); jaddnum(item,"volume",polarity > 0 ? dstr(ptr->Q.satoshis) : dstr(ptr->Q.destsatoshis)); jaddbits256(item,"txid",ptr->Q.txid);