jl777 7 years ago
parent
commit
0a45634278
  1. 10
      iguana/exchanges/LP_commands.c
  2. 10
      iguana/exchanges/LP_remember.c

10
iguana/exchanges/LP_commands.c

@ -120,10 +120,10 @@ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\
sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\
withdraw(coin, outputs[])\n\
sendrawtransaction(coin, signedtx)\n\
swapstatus(pending=0)\n\
swapstatus(pending=0, fast=0)\n\
swapstatus(coin, limit=10)\n\
swapstatus(base, rel, limit=10)\n\
swapstatus(requestid, quoteid, pending=0)\n\
swapstatus(requestid, quoteid, pending=0, fast=0)\n\
recentswaps(limit=3)\n\
notarizations(coin)\n\
public API:\n \
@ -336,10 +336,10 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
if ( (requestid= juint(argjson,"requestid")) != 0 && (quoteid= juint(argjson,"quoteid")) != 0 )
return(basilisk_swapentry(jint(argjson,"fast"),requestid,quoteid,1));
else if ( coin[0] != 0 )
return(basilisk_swapentries(coin,0,jint(argjson,"limit")));
return(basilisk_swapentries(1,coin,0,jint(argjson,"limit")));
else if ( base[0] != 0 && rel[0] != 0 )
return(basilisk_swapentries(base,rel,jint(argjson,"limit")));
else return(basilisk_swaplist(0,0,1,jint(argjson,"pending")));
return(basilisk_swapentries(1,base,rel,jint(argjson,"limit")));
else return(basilisk_swaplist(jint(argjson,"fast"),0,0,1,jint(argjson,"pending")));
}
else if ( strcmp(method,"dynamictrust") == 0 )
{

10
iguana/exchanges/LP_remember.c

@ -1513,7 +1513,7 @@ void for_satinder()
} else printf("error with satinder tx\n");
}
char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid,int32_t forceflag,int32_t pendingonly)
char *basilisk_swaplist(int32_t fastflag,uint32_t origrequestid,uint32_t origquoteid,int32_t forceflag,int32_t pendingonly)
{
uint64_t ridqids[4096],ridqid; char fname[512]; FILE *fp; cJSON *item,*retjson,*array,*totalsobj; uint32_t r,q,quoteid,requestid; int64_t KMDtotals[LP_MAXPRICEINFOS],BTCtotals[LP_MAXPRICEINFOS],Btotal,Ktotal; int32_t i,j,count=0;
//portable_mutex_lock(&LP_swaplistmutex);
@ -1526,7 +1526,7 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid,int32_t forc
if ( origrequestid != 0 && origquoteid != 0 )
{
//printf("orig req.%u q.%u\n",origrequestid,origquoteid);
if ( (item= basilisk_remember(0,KMDtotals,BTCtotals,origrequestid,origquoteid,forceflag,0)) != 0 )
if ( (item= basilisk_remember(fastflag,KMDtotals,BTCtotals,origrequestid,origquoteid,forceflag,0)) != 0 )
jaddi(array,item);
//printf("got.(%s)\n",jprint(item,0));
}
@ -1568,7 +1568,7 @@ char *basilisk_swaplist(uint32_t origrequestid,uint32_t origquoteid,int32_t forc
{
if ( count < sizeof(ridqids)/sizeof(*ridqids) )
ridqids[count++] = ridqid;
if ( (item= basilisk_remember(0,KMDtotals,BTCtotals,requestid,quoteid,0,pendingonly)) != 0 )
if ( (item= basilisk_remember(fastflag,KMDtotals,BTCtotals,requestid,quoteid,0,pendingonly)) != 0 )
jaddi(array,item);
}
}
@ -1733,14 +1733,14 @@ uint64_t basilisk_swap_addarray(cJSON *item,char *refbase,char *refrel)
return(ridqid);
}
char *basilisk_swapentries(char *refbase,char *refrel,int32_t limit)
char *basilisk_swapentries(int32_t fastflag,char *refbase,char *refrel,int32_t limit)
{
uint64_t ridqids[1024],ridqid; char *liststr,*retstr2; cJSON *retjson,*array,*pending,*swapjson,*item,*retarray; int32_t i,j,n,count = 0; uint32_t requestid,quoteid;
if ( limit <= 0 )
limit = 10;
memset(ridqids,0,sizeof(ridqids));
retarray = cJSON_CreateArray();
if ( (liststr= basilisk_swaplist(0,0,0,0)) != 0 )
if ( (liststr= basilisk_swaplist(fastflag,0,0,0,0)) != 0 )
{
//printf("swapentry.(%s)\n",liststr);
if ( (retjson= cJSON_Parse(liststr)) != 0 )

Loading…
Cancel
Save