Browse Source

Test

etomic
jl777 7 years ago
parent
commit
4871cf4331
  1. 5
      iguana/exchanges/LP_ordermatch.c

5
iguana/exchanges/LP_ordermatch.c

@ -887,10 +887,12 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru
double price,qprice,bestprice,range,bid,ask; struct iguana_info *coin; struct LP_utxoinfo A,B,*autxo,*butxo; cJSON *reqjson; char str[65]; struct LP_address_utxo *utxos[1000]; int32_t r,counter,max = (int32_t)(sizeof(utxos)/sizeof(*utxos)); double price,qprice,bestprice,range,bid,ask; struct iguana_info *coin; struct LP_utxoinfo A,B,*autxo,*butxo; cJSON *reqjson; char str[65]; struct LP_address_utxo *utxos[1000]; int32_t r,counter,max = (int32_t)(sizeof(utxos)/sizeof(*utxos));
*newqp = *qp; *newqp = *qp;
qp = newqp; qp = newqp;
printf("LP_trades_gotrequest\n");
if ( (coin= LP_coinfind(qp->srccoin)) == 0 ) if ( (coin= LP_coinfind(qp->srccoin)) == 0 )
return(0); return(0);
if ( (price= LP_trades_bobprice(&bid,&ask,qp)) == 0. ) if ( (price= LP_trades_bobprice(&bid,&ask,qp)) == 0. )
return(0); return(0);
printf("LP_trades_gotrequest price %.8f\n",price);
autxo = &A; autxo = &A;
butxo = &B; butxo = &B;
memset(autxo,0,sizeof(*autxo)); memset(autxo,0,sizeof(*autxo));
@ -907,6 +909,7 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru
memset(&qp->txid2,0,sizeof(qp->txid2)); memset(&qp->txid2,0,sizeof(qp->txid2));
qp->vout = qp->vout2 = -1; qp->vout = qp->vout2 = -1;
} else return(0); } else return(0);
printf("LP_trades_gotrequest qprice %.8f vs price %.8f\n",qprice,price);
if ( qprice > price ) if ( qprice > price )
{ {
r = (LP_rand() % 100); r = (LP_rand() % 100);
@ -1127,8 +1130,6 @@ void LP_tradesloop(void *ctx)
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
if ( now > tp->lastprocessed ) if ( now > tp->lastprocessed )
{ {
if ( tp->connectsent == 0 )
printf("lag.%d iambob.%d bestprice %.8f besttrust %.8f\n",now-tp->lastprocessed,tp->iambob,tp->bestprice,dstr(tp->besttrust));
if ( now < tp->firstprocessed+timeout ) if ( now < tp->firstprocessed+timeout )
{ {
if ( tp->iambob == 0 ) if ( tp->iambob == 0 )

Loading…
Cancel
Save