Browse Source

Test

etomic
jl777 7 years ago
parent
commit
b13cf6730f
  1. 2
      iguana/exchanges/LP_commands.c
  2. 7
      iguana/exchanges/LP_prices.c
  3. 2
      iguana/exchanges/LP_utxo.c

2
iguana/exchanges/LP_commands.c

@ -136,7 +136,7 @@ setconfirms(coin, numconfirms, maxconfirms=6)\n\
trust(pubkey, trust) # positive to trust, 0 for normal, negative to blacklist\n\
balance(coin, address)\n\
balances(address)\n\
fundvalue(address="", holdings=[])\n\
fundvalue(address="", holdings=[], divisor=0)\n\
orderbook(base, rel, duration=3600)\n\
getprices()\n\
getprice(base, rel)\n\

7
iguana/exchanges/LP_prices.c

@ -1131,7 +1131,7 @@ double LP_CMCbtcprice(char *symbol)
cJSON *LP_fundvalue(cJSON *argjson)
{
cJSON *holdings,*item,*newitem,*array,*retjson; int32_t i,iter,n; double btcprice,balance,btcsum; struct iguana_info *coin; char *symbol,*coinaddr; int64_t fundvalue,KMDvalue = 0;
cJSON *holdings,*item,*newitem,*array,*retjson; int32_t i,iter,n; double divisor,btcprice,balance,btcsum; struct iguana_info *coin; char *symbol,*coinaddr; int64_t fundvalue,KMDvalue = 0;
fundvalue = 0;
btcsum = 0.;
array = cJSON_CreateArray();
@ -1184,6 +1184,11 @@ cJSON *LP_fundvalue(cJSON *argjson)
jaddnum(retjson,"btcvalue",btcsum * btcprice);
}
jaddnum(retjson,"fundvalue",dstr(fundvalue));
if ( (divisor= jdouble(argjson,"divisor")) != 0 )
{
jaddnum(retjson,"divisor",divisor);
jaddnum(retjson,"fundvalue",dstr(fundvalue));
}
return(retjson);
}

2
iguana/exchanges/LP_utxo.c

@ -622,7 +622,7 @@ cJSON *LP_balances(char *coinaddr)
array = cJSON_CreateArray();
HASH_ITER(hh,LP_coins,coin,tmp)
{
if ( coinaddr != 0 && coinaddr[0] != 0 && strcmp(coinaddr,coin->smartaddr) != 0 )
if ( coin->electrum != 0 || (coinaddr != 0 && coinaddr[0] != 0 && strcmp(coinaddr,coin->smartaddr) != 0) )
{
bitcoin_addr2rmd160(0,&addrtype,rmd160,coinaddr);
bitcoin_address(address,coin->taddr,coin->pubtype,rmd160,20);

Loading…
Cancel
Save