From 5470b73651aca09cb9bbb594c9a9dba957ffa8eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Nov 2017 18:02:10 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 8 +++++++- iguana/exchanges/LP_nativeDEX.c | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 831675653..6a80ff7ed 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -342,9 +342,15 @@ bot_resume(botid)\n\ if ( LP_conflicts_find(ptr) == 0 ) { ptr->inactive = 0; - cJSON *array = cJSON_CreateArray(); + cJSON *array; if ( ptr->smartaddr[0] != 0 ) LP_unspents_load(coin,ptr->smartaddr); + if ( LP_getheight(ptr) <= 0 ) + { + ptr->inactive = (uint32_t)time(NULL); + return(clonestr("{\"error\":\"coin cant be activated till synced\"}")); + } else LP_unspents_load(coin,ptr->smartaddr); + array = cJSON_CreateArray(); jaddi(array,LP_coinjson(ptr,0)); return(jprint(array,1)); } else return(clonestr("{\"error\":\"coin port conflicts with existing coin\"}")); diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 907f790c0..09cb57a93 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -726,7 +726,7 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { if ( coin->addr_listunspent_requested != 0 && time(NULL) > coin->lastpushtime+10 ) { - printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); + //printf("PUSH addr_listunspent_requested %u\n",coin->addr_listunspent_requested); coin->lastpushtime = (uint32_t)time(NULL); LP_smartutxos_push(coin); coin->addr_listunspent_requested = 0; @@ -759,7 +759,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) { if ( LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); - LP_unspents_load(coin->symbol,coin->smartaddr); + else LP_unspents_load(coin->symbol,coin->smartaddr); } } if ( (n= cJSON_GetArraySize(coins)) > 0 ) @@ -776,7 +776,7 @@ void LP_initcoins(void *ctx,int32_t pubsock,cJSON *coins) { if ( LP_getheight(coin) <= 0 ) coin->inactive = (uint32_t)time(NULL); - LP_unspents_load(coin->symbol,coin->smartaddr); + else LP_unspents_load(coin->symbol,coin->smartaddr); } } }