From 5843dafb781e1a78fec52144149a281854f5bd10 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Nov 2017 23:51:55 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 5 ++++- iguana/exchanges/LP_nativeDEX.c | 4 ++-- iguana/exchanges/stats.c | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index af12cb1c2..b6cb2291c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -375,7 +375,10 @@ bot_resume(botid)\n\ if ( (ptr= LP_coinsearch(coin)) != 0 ) { ptr->inactive = 0; - return(jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1)); + retstr = jprint(LP_electrumserver(ptr,jstr(argjson,"ipaddr"),juint(argjson,"port")),1); + if ( ptr->electrum != 0 && (retjson= electrum_address_listunspent(ptr->symbol,ptr->electrum,&retjson,ptr->smartaddr,2)) != 0 ) + free_json(retjson); + return(retstr); } else return(clonestr("{\"error\":\"cant find coind\"}")); } else if ( strcmp(method,"sendrawtransaction") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index da0bd67fd..4c4c8a7ee 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1179,13 +1179,13 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( (rand() % 10000) == 0 ) + /*if ( (rand() % 1000) == 0 ) { int32_t sock = LP_bindsock; printf("bindsock reset test\n"); LP_bindsock = -1; closesocket(sock); - } + }*/ } #endif } diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 24f78f5bf..0c5cab321 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -751,6 +751,7 @@ void stats_rpcloop(void *args) localhostbits = (uint32_t)calc_ipbits("127.0.0.1"); while ( 1 ) { + printf("LP_bindsock.%d\n",LP_bindsock); if ( LP_bindsock < 0 ) { while ( (LP_bindsock= iguana_socket(1,"0.0.0.0",port)) < 0 )