From 085fe53ba1f943f38a4b35736c063704b60a2278 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 26 Nov 2017 22:13:57 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_prices.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 101440955..facf672e6 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -855,7 +855,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char * char *LP_orderbook(char *base,char *rel,int32_t duration) { - uint32_t now,i; int64_t depth; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; + uint32_t now,i; int64_t depth,askdepth=0,biddepth=0; struct LP_priceinfo *basepp=0,*relpp=0; struct LP_orderbookentry **bids = 0,**asks = 0; cJSON *retjson,*array; struct iguana_info *basecoin,*relcoin; int32_t n,numbids=0,numasks=0,cachenumbids,cachenumasks,baseid,relid,suppress_prefetch=0; basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( basecoin == 0 || relcoin == 0 ) @@ -902,6 +902,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) } for (i=n=0; idepth; jaddi(array,LP_orderbookjson(rel,bids[i])); if ( suppress_prefetch == 0 && n < 3 && bids[i]->numutxos == 0 ) { @@ -923,9 +924,11 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) relcoin->lastmonitor -= 3600; jadd(retjson,"bids",array); jaddnum(retjson,"numbids",numbids); + jaddnum(retjson,"biddepth",dstr(biddepth)); array = cJSON_CreateArray(); for (i=n=0; idepth; jaddi(array,LP_orderbookjson(base,asks[i])); if ( suppress_prefetch == 0 && n < 3 && asks[i]->numutxos == 0 ) { @@ -947,6 +950,7 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) basecoin->lastmonitor -= 3600; jadd(retjson,"asks",array); jaddnum(retjson,"numasks",numasks); + jaddnum(retjson,"askdepth",dstr(askdepth)); jaddstr(retjson,"base",base); jaddstr(retjson,"rel",rel); jaddnum(retjson,"timestamp",now);