|
@ -776,7 +776,8 @@ char *LP_bestfit(char *rel,double relvolume) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
struct LP_quoteinfo LP_Alicequery; |
|
|
struct LP_quoteinfo LP_Alicequery; |
|
|
double LP_Alicemaxprice; int32_t Alice_timeout; |
|
|
double LP_Alicemaxprice; |
|
|
|
|
|
uint32_t Alice_expiration; |
|
|
char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) |
|
|
char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp,double maxprice,int32_t timeout,int32_t duration) |
|
|
{ |
|
|
{ |
|
|
struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap;
|
|
|
struct LP_utxoinfo *aliceutxo; double price; //cJSON *bestitem=0; int32_t DEXselector=0; uint32_t expiration; double price; struct LP_pubkeyinfo *pubp; struct basilisk_swap *swap;
|
|
@ -787,7 +788,7 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q |
|
|
} |
|
|
} |
|
|
price = 0.; |
|
|
price = 0.; |
|
|
LP_query(ctx,myipaddr,mypubsock,"request",qp); |
|
|
LP_query(ctx,myipaddr,mypubsock,"request",qp); |
|
|
LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_timeout = timeout; |
|
|
LP_Alicequery = *qp, LP_Alicemaxprice = maxprice, Alice_expiration = qp->timestamp + timeout; |
|
|
return(clonestr("{\"result\":\"success\"}")); |
|
|
return(clonestr("{\"result\":\"success\"}")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -801,12 +802,12 @@ int32_t LP_quotecmp(struct LP_quoteinfo *qp,struct LP_quoteinfo *qp2) |
|
|
void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) |
|
|
void LP_reserved(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *qp) |
|
|
{ |
|
|
{ |
|
|
double price,maxprice = LP_Alicemaxprice; |
|
|
double price,maxprice = LP_Alicemaxprice; |
|
|
if ( 0 && time(NULL) > qp->timestamp+Alice_timeout ) |
|
|
if ( time(NULL) > Alice_expiration ) |
|
|
{ |
|
|
{ |
|
|
printf("time expired for Alice_request\n"); |
|
|
printf("time expired for Alice_request\n"); |
|
|
memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); |
|
|
memset(&LP_Alicequery,0,sizeof(LP_Alicequery)); |
|
|
LP_Alicemaxprice = 0.; |
|
|
LP_Alicemaxprice = 0.; |
|
|
Alice_timeout = 0; |
|
|
Alice_expiration = 0; |
|
|
} |
|
|
} |
|
|
else if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) |
|
|
else if ( LP_quotecmp(qp,&LP_Alicequery) == 0 ) |
|
|
{ |
|
|
{ |
|
|