jl777 7 years ago
parent
commit
d5b31da179
  1. 7
      iguana/exchanges/LP_coins.c
  2. 6
      iguana/exchanges/LP_prices.c

7
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);

6
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);

Loading…
Cancel
Save