Browse Source

Test

etomic
jl777 7 years ago
parent
commit
215551ac55
  1. 7
      iguana/exchanges/LP_ordermatch.c

7
iguana/exchanges/LP_ordermatch.c

@ -1041,7 +1041,7 @@ int32_t LP_trades_bestpricecheck(void *ctx,struct LP_trade *tp)
void LP_tradesloop(void *ctx) void LP_tradesloop(void *ctx)
{ {
struct LP_trade *qtp,*tp,*tmp; struct LP_quoteinfo *qp,Q; uint32_t now; int32_t funcid,flag,nonz = 0; struct LP_trade *qtp,*tp,*tmp; struct LP_quoteinfo *qp,Q; uint32_t now; int32_t funcid,flag,nonz;
strcpy(LP_tradesloop_stats.name,"LP_tradesloop"); strcpy(LP_tradesloop_stats.name,"LP_tradesloop");
LP_tradesloop_stats.threshold = 10000; LP_tradesloop_stats.threshold = 10000;
sleep(5); sleep(5);
@ -1050,6 +1050,8 @@ void LP_tradesloop(void *ctx)
LP_millistats_update(&LP_tradesloop_stats); LP_millistats_update(&LP_tradesloop_stats);
DL_FOREACH_SAFE(LP_tradesQ,qtp,tmp) DL_FOREACH_SAFE(LP_tradesQ,qtp,tmp)
{ {
nonz = 0;
printf("dequeued %p\n",qtp);
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
Q = qtp->Q; Q = qtp->Q;
funcid = qtp->funcid; funcid = qtp->funcid;
@ -1075,6 +1077,7 @@ void LP_tradesloop(void *ctx)
continue; continue;
} }
portable_mutex_unlock(&LP_tradesmutex); portable_mutex_unlock(&LP_tradesmutex);
tp->Q = qtp->Q;
if ( qtp->iambob == tp->iambob && qtp->pairstr[0] != 0 ) if ( qtp->iambob == tp->iambob && qtp->pairstr[0] != 0 )
safecopy(tp->pairstr,qtp->pairstr,sizeof(tp->pairstr)); safecopy(tp->pairstr,qtp->pairstr,sizeof(tp->pairstr));
free(qtp); free(qtp);
@ -1120,6 +1123,7 @@ void LP_tradesloop(void *ctx)
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
if ( now > tp->lastprocessed+1 ) if ( now > tp->lastprocessed+1 )
{ {
if ( tp->connectsent == 0 )
printf("lag.%d iambob.%d bestprice %.8f besttrust %.8f\n",now-tp->lastprocessed,tp->iambob,tp->bestprice,dstr(tp->besttrust)); printf("lag.%d iambob.%d bestprice %.8f besttrust %.8f\n",now-tp->lastprocessed,tp->iambob,tp->bestprice,dstr(tp->besttrust));
if ( now < tp->firstprocessed+60 ) if ( now < tp->firstprocessed+60 )
{ {
@ -1180,6 +1184,7 @@ void LP_tradecommandQ(struct LP_quoteinfo *qp,char *pairstr,int32_t funcid)
safecopy(qtp->pairstr,pairstr,sizeof(qtp->pairstr)); safecopy(qtp->pairstr,pairstr,sizeof(qtp->pairstr));
DL_APPEND(LP_tradesQ,qtp); DL_APPEND(LP_tradesQ,qtp);
portable_mutex_unlock(&LP_tradesmutex); portable_mutex_unlock(&LP_tradesmutex);
printf("queued %p\n",qtp);
} }
/* } /* }
else if ( tp->iambob == iambob ) else if ( tp->iambob == iambob )

Loading…
Cancel
Save