Browse Source

Test

etomic
jl777 8 years ago
parent
commit
f90dbc3e4a
  1. 8
      iguana/exchanges/LP_swap.c
  2. 2
      iguana/exchanges/LP_utxos.c

8
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) 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); printf("wait %d:%d for SWAP.(r%u/q%u) to complete\n",duration,sleeptime,requestid,quoteid);
sleep(10); sleep(10);
if ( sleeptime < divisor*60 )
sleeptime = divisor * 60;
while ( time(NULL) < expiration ) while ( time(NULL) < expiration )
{ {
if ( (retstr= basilisk_swapentry(requestid,quoteid)) != 0 ) 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); free(retstr);
} }
sleep(sleeptime); sleep(sleeptime/divisor);
if ( divisor > 1 )
divisor--;
} }
if ( retjson != 0 ) if ( retjson != 0 )
{ {

2
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; targetval = (depositval / 776) + 100000;
else targetval = (depositval / 9) * 8 + 100000; else targetval = (depositval / 9) * 8 + 100000;
//printf("i.%d %.8f target %.8f\n",i,dstr(depositval),dstr(targetval)); //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 ) if ( (i= LP_nearestvalue(values,n,targetval)) >= 0 )
{ {
item = jitem(array,i); item = jitem(array,i);

Loading…
Cancel
Save