Browse Source

Test

etomic
jl777 7 years ago
parent
commit
6af7acf8fe
  1. 15
      iguana/exchanges/LP_remember.c

15
iguana/exchanges/LP_remember.c

@ -1044,6 +1044,13 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid)
//,statebits; int32_t optionduration; struct basilisk_request R; bits256 privkey;
retjson = cJSON_CreateObject();
array = cJSON_CreateArray();
if ( origrequestid != 0 && origquoteid != 0 )
{
if ( (item= basilisk_remember(KMDtotals,BTCtotals,origrequestid,origquoteid)) != 0 )
jaddi(array,item);
}
else
{
sprintf(fname,"%s/SWAPS/list",GLOBAL_DBDIR), OS_compatible_path(fname);
if ( (fp= fopen(fname,"rb")) != 0 )
{
@ -1057,8 +1064,6 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid)
r = (uint32_t)(G.LP_skipstatus[i] >> 32);
q = (uint32_t)G.LP_skipstatus[i];
if ( r == requestid && q == quoteid )
{
if ( r != origrequestid || q != origquoteid )
{
item = cJSON_CreateObject();
jaddstr(item,"status","realtime");
@ -1066,22 +1071,18 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid)
jaddnum(item,"quoteid",q);
jaddi(array,item);
flag = 1;
}
break;
}
}
if ( flag == 0 )
{
if ( (item= basilisk_remember(KMDtotals,BTCtotals,requestid,quoteid)) != 0 )
{
jaddi(array,item);
//if ( (status= jstr(item,"status")) != 0 && strcmp(status,"pending") == 0 )
// break;
}
}
}
fclose(fp);
}
}
jaddstr(retjson,"result","success");
jadd(retjson,"swaps",array);
if ( 0 && cJSON_GetArraySize(array) > 0 )

Loading…
Cancel
Save