From 3ef1dc48076f106a6412df22ead93a62bf116afc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 2 Oct 2017 11:37:13 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 1 - iguana/exchanges/LP_ordermatch.c | 1 - iguana/exchanges/LP_portfolio.c | 6 +++++- iguana/exchanges/LP_prices.c | 1 - iguana/exchanges/LP_rpc.c | 4 +--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 3fe84aff7..e15ab19b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -322,7 +322,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer) if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; total = 0; - printf("from utxos_sync\n"); LP_listunspent_both(coin->symbol,coin->smartaddr); if ( (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 38e5e9685..ee90ee06a 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -695,7 +695,6 @@ int32_t LP_listunspent_both(char *symbol,char *coinaddr) //printf("issue path electrum.%p\n",coin->electrum); //if ( coin->electrum != 0 && (array= electrum_address_gethistory(symbol,coin->electrum,&array,coinaddr)) != 0 ) // free_json(array); - printf("listunspent_both\n"); n = LP_listunspent_issue(symbol,coinaddr); } else diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 585f236f1..e648e3381 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -89,7 +89,7 @@ char *LP_portfolio() { HASH_ITER(hh,LP_coins,coin,tmp) { - if ( coin->inactive != 0 ) + if ( coin->inactive != 0 || coin->obooktime == 0 ) continue; if ( iter == 0 ) { @@ -184,12 +184,16 @@ char *LP_portfolio_goal(char *symbol,double goal) coin->goal = kmdbtc * 0.5; if ( (coin= LP_coinfind("BTC")) != 0 && coin->inactive == 0 ) coin->goal = kmdbtc * 0.5; + if ( coin->goal != 0 ) + coin->obooktime = (uint32_t)time(NULL); return(LP_portfolio()); } else if ( (coin= LP_coinfind(symbol)) != 0 && coin->inactive == 0 ) { coin->goal = goal; printf("set %s goal %f\n",coin->symbol,goal); + if ( coin->goal != 0 ) + coin->obooktime = (uint32_t)time(NULL); return(LP_portfolio()); } else return(clonestr("{\"error\":\"cant set goal for inactive coin\"}")); } diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 5cbff8581..93733a9b0 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -224,7 +224,6 @@ char *LP_pubkey_trustset(bits256 pubkey,uint32_t trustval) uint64_t LP_unspents_metric(struct iguana_info *coin,char *coinaddr) { cJSON *array,*item; int32_t i,n; uint64_t metric=0,total; - printf("unspents metric\n"); LP_listunspent_both(coin->symbol,coinaddr); if ( (array= LP_address_utxos(coin,coinaddr,1)) != 0 ) { diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 973fa2f5e..4f7e66fdc 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -491,9 +491,7 @@ int32_t LP_listunspent_issue(char *symbol,char *coinaddr) { n = cJSON_GetArraySize(retjson); printf("LP_listunspent_issue.%s %s.%d %s\n",symbol,coinaddr,n,jprint(retjson,0)); - if ( strcmp(symbol,"ARG") == 0 ) - assert(0); - } + } } else {