Browse Source

Test

etomic
jl777 8 years ago
parent
commit
8ac57c2d15
  1. 3
      iguana/exchanges/LP_prices.c

3
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) cJSON *LP_orderbookjson(struct LP_cacheinfo *ptr,int32_t polarity)
{ {
double price; cJSON *item = cJSON_CreateObject(); 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,"price",polarity > 0 ? price : 1. / price);
jaddnum(item,"volume",polarity > 0 ? dstr(ptr->Q.satoshis) : dstr(ptr->Q.destsatoshis)); jaddnum(item,"volume",polarity > 0 ? dstr(ptr->Q.satoshis) : dstr(ptr->Q.destsatoshis));
jaddbits256(item,"txid",ptr->Q.txid); jaddbits256(item,"txid",ptr->Q.txid);

Loading…
Cancel
Save