diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a5a8677e9..31742b3f9 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1197,11 +1197,19 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu free(retstr); } else printf("issue_hello NULL return\n"); lasthello = (uint32_t)time(NULL); - if ( allgood == 0 ) + if ( (rand() % 10000) == 0 || 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("error launching stats rpcloop for port.%u\n",myport); + exit(-1); + } } } }