From f90dbc3e4a2d412f483c11c164512fa6fd55f365 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 23 Jun 2017 12:24:23 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_swap.c | 8 ++++++-- iguana/exchanges/LP_utxos.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 0079c1d35..6f0c8aa34 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -622,9 +622,11 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t sleeptime) { - char *retstr; cJSON *retjson=0; uint32_t expiration = (uint32_t)(time(NULL) + duration); + 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; while ( time(NULL) < expiration ) { if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) @@ -638,7 +640,9 @@ int32_t LP_swapwait(uint32_t requestid,uint32_t quoteid,int32_t duration,int32_t } free(retstr); } - sleep(sleeptime); + sleep(sleeptime/divisor); + if ( divisor > 1 ) + divisor--; } if ( retjson != 0 ) { diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index b8c30c953..f86cbb0b0 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -689,6 +689,8 @@ uint64_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypr targetval = (depositval / 776) + 100000; else targetval = (depositval / 9) * 8 + 100000; //printf("i.%d %.8f target %.8f\n",i,dstr(depositval),dstr(targetval)); + if ( (i= LP_nearestvalue(values,n,targetval)) < 0 && iambob != 0 ) + targetval /= 4; if ( (i= LP_nearestvalue(values,n,targetval)) >= 0 ) { item = jitem(array,i);