From 734e8c8a8f34e0043cce5f44671cc88f8dabc045 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 5 Dec 2017 16:46:35 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_prices.c | 14 ++++++++------ iguana/exchanges/supernet | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index ed558e10f..806059bba 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -1159,7 +1159,7 @@ cJSON *LP_fundvalue(cJSON *argjson) { newitem = cJSON_CreateObject(); jaddstr(newitem,"coin",symbol); - jaddnum(newitem,"balance",dstr(balance)); + jaddnum(newitem,"balance",balance); if ( (coin= LP_coinfind(symbol)) != 0 && (KMDvalue= LP_KMDvalue(coin,SATOSHIDEN * balance)) > 0 ) { jaddnum(newitem,"KMD",dstr(KMDvalue)); @@ -1180,11 +1180,13 @@ cJSON *LP_fundvalue(cJSON *argjson) jadd(retjson,"holdings",array); if ( btcsum != 0 ) { - btcprice = LP_CMCbtcprice("komodo"); - fundvalue += (btcprice * btcsum) * SATOSHIDEN; - jaddnum(retjson,"KMD_BTC",btcprice); - jaddnum(retjson,"btcsum",btcsum); - jaddnum(retjson,"btcvalue",btcsum * btcprice); + if ( (btcprice= LP_CMCbtcprice("komodo")) > SMALLVAL ) + { + fundvalue += (btcsum / btcprice) * SATOSHIDEN; + jaddnum(retjson,"KMD_BTC",btcprice); + jaddnum(retjson,"btcsum",btcsum); + jaddnum(retjson,"btcvalue",btcsum / btcprice); + } } jaddnum(retjson,"fundvalue",dstr(fundvalue)); if ( (divisor= jdouble(argjson,"divisor")) != 0 ) diff --git a/iguana/exchanges/supernet b/iguana/exchanges/supernet index 803341f7a..0b71993f4 100755 --- a/iguana/exchanges/supernet +++ b/iguana/exchanges/supernet @@ -2,3 +2,5 @@ source userpass # this will only work for watchonly addresses that have been rescanned and with active coins curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balances\",\"address\":\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\"}" + +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"fundvalue\",\"address\":\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\",\"holdings\":[{\"coin\":\"iota\",\"balance\":13000000}, {\"coin\":\"stratis\",\"balance\":1300000}, {\"coin\":\"zcash\",\"balance\":10000}, {\"coin\":\"syscoin\",\"balance\":20000000}, {\"coin\":\"waves\",\"balance\":700000}, {\"coin\":\"bitcoin\",\"balance\":625}, {\"coin\":\"bitcoin-cash\",\"balance\":1500}, {\"coin\":\"heat-ledger\",\"balance\":2323851 }, {\"coin\":\"decred\",\"balance\":20000}, {\"coin\":\"vericoin\",\"balance\":2199368 }, {\"coin\":\"byteball\",\"balance\":4238}, {\"coin\":\"iocoin\",\"balance\":150000}, {\"coin\":\"quantum-resistant-ledger\",\"balance\":375000}, {\"coin\":\"chips\",\"balance\":2577006 }, {\"coin\":\"hush\",\"balance\":100000 }, {\"coin\":\"mobilego\",\"balance\":100000 }],\"divisor\":650000}"