jl777 7 years ago
parent
commit
23339d6359
  1. 10
      iguana/exchanges/LP_ordermatch.c
  2. 6
      iguana/exchanges/LP_stats.c

10
iguana/exchanges/LP_ordermatch.c

@ -371,8 +371,8 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,struct LP_utxoinfo *utxo,cJ
retjson = LP_quotejson(qp);
jaddstr(retjson,"method","connected");
jaddstr(retjson,"pair",pairstr);
jaddnum(retjson,"requestid",qp->R.requestid);
jaddnum(retjson,"quoteid",qp->R.quoteid);
//jaddnum(retjson,"requestid",qp->R.requestid);
//jaddnum(retjson,"quoteid",qp->R.quoteid);
// LP_addsig
char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,utxo->S.otherpubkey));
LP_reserved_msg(base,rel,utxo->S.otherpubkey,jprint(retjson,0));
@ -529,10 +529,10 @@ char *LP_connectedalice(cJSON *argjson) // alice
printf("alice pairstr.(%s) pairsock.%d\n",pairstr,pairsock);
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_aliceloop,(void *)swap) == 0 )
{
retjson = LP_quotejson(&Q);
jaddstr(retjson,"result","success");
jadd(retjson,"trade",LP_quotejson(&Q));
jaddnum(retjson,"requestid",Q.R.requestid);
jaddnum(retjson,"quoteid",Q.R.quoteid);
//jaddnum(retjson,"requestid",Q.R.requestid);
//jaddnum(retjson,"quoteid",Q.R.quoteid);
} else jaddstr(retjson,"error","couldnt aliceloop");
} else printf("connect error %s\n",nn_strerror(nn_errno()));
printf("connected result.(%s)\n",jprint(retjson,0));

6
iguana/exchanges/LP_stats.c

@ -99,7 +99,7 @@ int32_t LP_statslog_parsequote(char *method,cJSON *lineobj)
void LP_statslog_parseline(cJSON *lineobj)
{
char *method;
char *method; cJSON *obj;
if ( (method= jstr(lineobj,"method")) != 0 )
{
if ( strcmp(method,"request") == 0 )
@ -108,7 +108,9 @@ void LP_statslog_parseline(cJSON *lineobj)
LP_reserveds++;
else if ( strcmp(method,"connect") == 0 )
{
LP_statslog_parsequote(method,lineobj);
if ( (obj= jobj(lineobj,"trade")) == 0 )
obj = lineobj;
LP_statslog_parsequote(method,obj);
LP_connects++;
}
else if ( strcmp(method,"connected") == 0 )

Loading…
Cancel
Save