From aea6102369f1b4c60a71cc35876f1a9cef0abff8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:12:25 +0200 Subject: [PATCH 1/3] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- iguana/exchanges/LP_rpc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9d90bfa7e..e26ce29b5 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1181,7 +1181,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( time(NULL) > lasthello+60 ) + if ( time(NULL) > lasthello+600 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; allgood = 0; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 5b5791239..43dd88d52 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -98,7 +98,7 @@ char *issue_hello(uint16_t port) char url[512]; sprintf(url,"http://127.0.0.1:%u/api/stats/hello",port); //printf("getutxo.(%s)\n",url); - return(issue_curlt(url,60)); // might be starting a trade + return(issue_curlt(url,600)); // might be starting a trade } char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) From c9dba66fe0a9451e4e285b2af6a6d5189b9d8917 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:15:07 +0200 Subject: [PATCH 2/3] Test --- iguana/exchanges/LP_nativeDEX.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e26ce29b5..7ea525e43 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1199,16 +1199,19 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu lasthello = (uint32_t)time(NULL); if ( allgood == 0 ) { - printf("RPC port got stuck, close bindsocket\n"); - LP_bindsock = -1; - closesocket(sock); - LP_bindsock_reset++; - sleep(10); - printf("launch new rpcloop\n"); - if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + printf("RPC port got stuck, would have close bindsocket\n"); + if ( 0 ) { - printf("error launching stats rpcloop for port.%u\n",myport); - exit(-1); + LP_bindsock = -1; + closesocket(sock); + LP_bindsock_reset++; + sleep(10); + printf("launch new rpcloop\n"); + if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)stats_rpcloop,(void *)&myport) != 0 ) + { + printf("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } } } } From 68ea59584c988d41f5ccb29a3a143b2dea71bba4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 17:15:38 +0200 Subject: [PATCH 3/3] Test --- iguana/exchanges/LP_nativeDEX.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 7ea525e43..c43655e3e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1181,7 +1181,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu usleep(1000); else if ( IAMLP == 0 ) usleep(1000); - if ( time(NULL) > lasthello+600 ) + if ( IAMLP != 0 && time(NULL) > lasthello+600 ) { char *hellostr,*retstr; cJSON *retjson; int32_t allgood,sock = LP_bindsock; allgood = 0;