Browse Source

Guarantee requested in buy/sell

jl777
jl777 7 years ago
parent
commit
491da5ccac
  1. 2
      iguana/exchanges/LP_commands.c
  2. 2
      iguana/exchanges/LP_ordermatch.c
  3. 11
      iguana/exchanges/LP_remember.c
  4. 2
      iguana/exchanges/LP_tradebots.c
  5. 2
      iguana/exchanges/coins

2
iguana/exchanges/LP_commands.c

@ -306,7 +306,7 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
}*/
else if ( strcmp(method,"recentswaps") == 0 )
{
return(LP_recent_swaps(jint(argjson,"limit")));
return(LP_recent_swaps(jint(argjson,"limit"),0));
}
else if ( strcmp(method,"stop") == 0 )
{

2
iguana/exchanges/LP_ordermatch.c

@ -579,7 +579,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q
LP_query(ctx,myipaddr,mypubsock,"request",qp);
LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout, LP_Alicedestpubkey = destpubkey;
char str[65]; printf("LP_trade %s/%s %.8f vol %.8f dest.(%s) maxprice %.8f etomicdest.(%s)\n",qp->srccoin,qp->destcoin,dstr(qp->satoshis),dstr(qp->destsatoshis),bits256_str(str,LP_Alicedestpubkey),maxprice,qp->etomicdest);
return(LP_recent_swaps(0));
return(LP_recent_swaps(0,qp->requestid));
}
int32_t LP_quotecmp(int32_t strictflag,struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2)

11
iguana/exchanges/LP_remember.c

@ -1681,7 +1681,7 @@ char *basilisk_swapentry(int32_t fastflag,uint32_t requestid,uint32_t quoteid,in
extern struct LP_quoteinfo LP_Alicequery;
extern uint32_t Alice_expiration;
char *LP_recent_swaps(int32_t limit)
char *LP_recent_swaps(int32_t limit,uint32_t origrequestid)
{
char fname[512],*retstr,*base,*rel,*statusstr; long fsize,offset; FILE *fp; int32_t baseind,relind,i=0; uint32_t requestid,quoteid; cJSON *array,*item,*retjson,*subitem,*swapjson; int64_t KMDtotals[LP_MAXPRICEINFOS],BTCtotals[LP_MAXPRICEINFOS]; double srcamount,destamount,netamounts[LP_MAXPRICEINFOS];
memset(KMDtotals,0,sizeof(KMDtotals));
@ -1775,6 +1775,11 @@ char *LP_recent_swaps(int32_t limit)
jadd64bits(item,"aliceid",LP_aliceid_calc(LP_Alicequery.desttxid,LP_Alicequery.destvout,LP_Alicequery.feetxid,LP_Alicequery.feevout));
jadd(retjson,"pending",item);
} else Alice_expiration = 0;
if ( origrequestid != 0 )
{
jaddnum(retjson,"requestid",origrequestid);
jaddnum(retjson,"desthash",G.LP_mypub25519);
}
return(jprint(retjson,1));
}
@ -1833,7 +1838,7 @@ char *basilisk_swapentries(int32_t fastflag,char *refbase,char *refrel,int32_t l
}
free(liststr);
}
if ( (liststr= LP_recent_swaps(limit)) != 0 )
if ( (liststr= LP_recent_swaps(limit,0)) != 0 )
{
if ( (retjson= cJSON_Parse(liststr)) != 0 )
{
@ -1894,7 +1899,7 @@ char *basilisk_swapentries(int32_t fastflag,char *refbase,char *refrel,int32_t l
int32_t LP_pendingswap(uint32_t requestid,uint32_t quoteid)
{
cJSON *retjson,*array,*pending,*item; uint32_t r,q; char *retstr; int32_t i,n,retval = 0;
if ( (retstr= LP_recent_swaps(1000)) != 0 )
if ( (retstr= LP_recent_swaps(1000,0)) != 0 )
{
if ( (retjson= cJSON_Parse(retstr)) != 0 )
{

2
iguana/exchanges/LP_tradebots.c

@ -322,7 +322,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot)
LP_tradebot_calcstats(bot);
if ( bot->dead == 0 && bot->pause == 0 && bot->userpause == 0 && bot->numtrades < sizeof(bot->trades)/sizeof(*bot->trades) )
{
if ( (liststr= LP_recent_swaps(0)) != 0 )
if ( (liststr= LP_recent_swaps(0,0)) != 0 )
{
if ( (retjson= cJSON_Parse(liststr)) != 0 )
{

2
iguana/exchanges/coins

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save