From 422317a7ae35da8646bb9d2537936bd506803cc5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 May 2018 18:04:23 +0300 Subject: [PATCH 1/3] Coinmarketcap v2 api --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 05897a953..41eefc8e3 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -1147,7 +1147,7 @@ void calc_rmd160_sha256(uint8_t rmd160[20],uint8_t *data,int32_t datalen) char *cmc_ticker(char *base) { char url[512]; - sprintf(url,"https://api.coinmarketcap.com/v1/ticker/%s/",base); + sprintf(url,"https://api.coinmarketcap.com/v2/ticker/%s/",base); return(issue_curl(url)); } From 710227aedffa622b6b4e77628cbe76e286e5752a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 10 May 2018 10:21:53 +0300 Subject: [PATCH 2/3] Revert portfolio caching --- iguana/exchanges/LP_nativeDEX.c | 2 -- iguana/exchanges/LP_portfolio.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 5a291227c..7270ca787 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -570,8 +570,6 @@ void LP_coinsloop(void *_coins) memset(&zero,0,sizeof(zero)); if ( coin->inactive != 0 ) continue; - coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); - coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); if ( coin->did_addrutxo_reset == 0 ) { int32_t num; diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 54f7365a0..276e27f3b 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -143,14 +143,14 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 || coin->balanceA == 0 || coin->balanceB == 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) + if ( coin->inactive != 0 )//|| (coin->electrum != 0 && coin->obooktime == 0) ) continue; if ( iter == 0 ) { //printf("from portfolio\n"); //LP_privkey_init(-1,coin,G.LP_privkey,G.LP_mypub25519); - //coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); - //coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); + coin->balanceA = LP_balance(&coin->valuesumA,0,coin->symbol,coin->smartaddr); + coin->balanceB = LP_balance(&coin->valuesumB,1,coin->symbol,coin->smartaddr); if ( strcmp(coin->symbol,"KMD") != 0 ) coin->price_kmd = LP_price(coin->symbol,"KMD"); else coin->price_kmd = 1.; From bc676d57dc1e028486258e99f6a8c438cdd26de1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 10 May 2018 10:23:08 +0300 Subject: [PATCH 3/3] Revert cmc v2 to v1 --- crypto777/iguana_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 41eefc8e3..05897a953 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -1147,7 +1147,7 @@ void calc_rmd160_sha256(uint8_t rmd160[20],uint8_t *data,int32_t datalen) char *cmc_ticker(char *base) { char url[512]; - sprintf(url,"https://api.coinmarketcap.com/v2/ticker/%s/",base); + sprintf(url,"https://api.coinmarketcap.com/v1/ticker/%s/",base); return(issue_curl(url)); }