From 89d66662bbe404a0adc2cbb9a296310db7f1cbc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:52:52 +0300 Subject: [PATCH 1/4] 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 694901cf4..9bc850539 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -308,7 +308,7 @@ void command_rpcloop(void *myipaddr) //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) - usleep(10000); + usleep(10); } } From 0725deb0ffcd16ae6053f2a37648c4f4ce3c1381 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:53:32 +0300 Subject: [PATCH 2/4] Test --- iguana/exchanges/LP_nativeDEX.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9bc850539..0d6d6ec1b 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -308,7 +308,11 @@ void command_rpcloop(void *myipaddr) //if ( LP_mybussock >= 0 ) // nonz += LP_sock_check("BUS",ctx,origipaddr,-1,LP_mybussock); if ( nonz == 0 ) - usleep(10); + { + if ( IAMLP != 0 ) + usleep(10); + else usleep(1000); + } } } From 2e011b6ab2762d74921223472f33f8f813390fc8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 02:55:47 +0300 Subject: [PATCH 3/4] Test --- iguana/exchanges/LP_nativeDEX.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0d6d6ec1b..627f507ae 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -524,6 +524,8 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int break; } coin->lastscanht++; + if ( coin->lastscanht == coin->longestchain+1 ) + break; } if ( j < 100 ) continue; From 45cae6913d8d4890b588e895e35e9efb37e25081 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Oct 2017 03:03:48 +0300 Subject: [PATCH 4/4] Test --- iguana/exchanges/LP_swap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index f71256d87..0f839b6af 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -674,8 +674,8 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t char *retstr; cJSON *retjson=0; uint32_t divisor=8,expiration = (uint32_t)(time(NULL) + duration); printf("wait %d:%d for SWAP.(r%u/q%u) to complete\n",duration,sleeptime,requestid,quoteid); sleep(10); - if ( sleeptime < divisor*60 ) - sleeptime = divisor * 60; + //if ( sleeptime < divisor*60 ) + // sleeptime = divisor * 60; while ( time(NULL) < expiration ) { if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) @@ -690,9 +690,10 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t } free(retstr); } - sleep(sleeptime/divisor); - if ( divisor > 1 ) - divisor--; + sleep(sleeptime); + //sleep(sleeptime/divisor); + //if ( divisor > 1 ) + // divisor--; } if ( retjson != 0 ) { @@ -759,7 +760,7 @@ void LP_bobloop(void *_swap) basilisk_bobpayment_reclaim(swap,swap->I.callduration); if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,300); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); } } } @@ -823,7 +824,7 @@ void LP_aliceloop(void *_swap) } if ( swap->N.pair >= 0 ) nn_close(swap->N.pair), swap->N.pair = -1; - LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,300); + LP_swapwait(swap->I.req.requestid,swap->I.req.quoteid,4*3600,30); } } }