From a6b934d24d64882325034dee551896e6b70ed647 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 20:33:01 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_utxo.c | 10 +++++++--- iguana/exchanges/balance | 2 +- iguana/exchanges/install | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index fe7040494..ab9219412 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -296,16 +296,20 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electrumret) { - cJSON *array,*retjson; double balance = 0.; + cJSON *array,*retjson; int32_t i,n; uint64_t balance = 0; if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { - + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; isymbol); jaddstr(retjson,"address",coinaddr); - jaddnum(retjson,"balance",balance); + jaddnum(retjson,"balance",dstr(balance)); return(retjson); } diff --git a/iguana/exchanges/balance b/iguana/exchanges/balance index 4a184f8f4..22f84cdee 100755 --- a/iguana/exchanges/balance +++ b/iguana/exchanges/balance @@ -1,3 +1,3 @@ #!/bin/bash source userpass -curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balance\",\"coin\":\"BTC\",\"address\":\"1DPDsPCNNCF5SHhPPrddXcJe78rM6CBcH3\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"balance\",\"coin\":\"KMD\",\"address\":\"RHV2As4rox97BuE3LK96vMeNY8VsGRTmBj\"}" diff --git a/iguana/exchanges/install b/iguana/exchanges/install index a3632447b..3f64033f1 100755 --- a/iguana/exchanges/install +++ b/iguana/exchanges/install @@ -1,5 +1,5 @@ #!/bin/bash -cp electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts +cp balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug register registerall buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices getutxos help inv setprice status utxos ../dexscripts cd ../dexscripts #cp ../exchanges/passphrase ../exchanges/userpass . #echo you will need to have a passphrase file with your passphrase and userpass file with userpass value in dexscripts dir