From d5b31da179834c2d3f7fd0dee7ad7de42ccb0ccf Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 11:53:52 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_coins.c | 7 ++++++- iguana/exchanges/LP_prices.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 6f0b1d76d..6ab37355c 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -172,7 +172,7 @@ int32_t LP_userpass(char *userpass,char *symbol,char *assetname,char *confroot,c cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) { - char wifstr[128]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); + struct electrum_info *ep; char wifstr[128],ipaddr[64]; uint8_t tmptype; bits256 checkkey; cJSON *item = cJSON_CreateObject(); jaddstr(item,"coin",coin->symbol); if ( showwif != 0 ) { @@ -187,6 +187,11 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) else jaddstr(item,"status","active"); if ( coin->isPoS != 0 ) jaddstr(item,"type","PoS"); + if ( (ep= coin->electrum) != 0 ) + { + sprintf(ipaddr,"%s:%u",ep->ipaddr,ep->port); + jaddstr(item,"electrum",ipaddr); + } jaddstr(item,"smartaddress",coin->smartaddr); jaddstr(item,"rpc",coin->serverport); jaddnum(item,"pubtype",coin->pubtype); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index fbcd54749..430448a29 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -709,6 +709,8 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) free(bids[i]); bids[i] = 0; } + if ( n > 0 && relcoin->lastmonitor > 3600 ) + relcoin->lastmonitor -= 3600; jadd(retjson,"bids",array); jaddnum(retjson,"numbids",numbids); array = cJSON_CreateArray(); @@ -720,10 +722,8 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) free(asks[i]); asks[i] = 0; } - if ( basecoin->lastmonitor > 3600 ) + if ( n > 0 && basecoin->lastmonitor > 3600 ) basecoin->lastmonitor -= 3600; - if ( relcoin->lastmonitor > 3600 ) - relcoin->lastmonitor -= 3600; jadd(retjson,"asks",array); jaddnum(retjson,"numasks",numasks); jaddstr(retjson,"base",base);