Browse Source

Test

etomic
jl777 7 years ago
parent
commit
d96814434a
  1. 7
      iguana/exchanges/LP_commands.c
  2. 3
      iguana/exchanges/LP_nativeDEX.c
  3. 2
      iguana/exchanges/LP_stats.c

7
iguana/exchanges/LP_commands.c

@ -596,8 +596,15 @@ zeroconf_claim(address, expiration=0)\n\
else if ( strcmp(method,"tradestatus") == 0 )
{
bits256 zero; cJSON *tmpjson;
LP_tradecommand_log(argjson);
printf("GOT TRADESTATUS! %s\n",jprint(argjson,0));
if ( LP_statslog_parse() > 0 )
{
memset(zero.bytes,0,sizeof(zero));
if ( (tmpjson= LP_statslog_disp(2000000000,2000000000,"",zero,0,0))) // pending swaps
free_json(tmpjson);
}
retstr = clonestr("{\"result\":\"success\"}");
}
else if ( strcmp(method,"wantnotify") == 0 )

3
iguana/exchanges/LP_nativeDEX.c

@ -90,7 +90,7 @@ void LP_millistats_update(struct LP_millistats *mp)
}
#include "LP_include.h"
portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex,LP_inusemutex,LP_cJSONmutex;
portable_mutex_t LP_peermutex,LP_UTXOmutex,LP_utxomutex,LP_commandmutex,LP_cachemutex,LP_swaplistmutex,LP_forwardmutex,LP_pubkeymutex,LP_networkmutex,LP_psockmutex,LP_coinmutex,LP_messagemutex,LP_portfoliomutex,LP_electrummutex,LP_butxomutex,LP_reservedmutex,LP_nanorecvsmutex,LP_tradebotsmutex,LP_gcmutex,LP_inusemutex,LP_cJSONmutex,LP_logmutex;
int32_t LP_canbind;
char *Broadcaststr,*Reserved_msgs[2][1000];
int32_t num_Reserved_msgs[2],max_Reserved_msgs[2];
@ -1103,6 +1103,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu
portable_mutex_init(&LP_nanorecvsmutex);
portable_mutex_init(&LP_tradebotsmutex);
portable_mutex_init(&LP_cJSONmutex);
portable_mutex_init(&LP_logmutex);
myipaddr = clonestr("127.0.0.1");
#ifndef _WIN32
#ifndef FROM_JS

2
iguana/exchanges/LP_stats.c

@ -30,6 +30,7 @@ static uint32_t LP_requests,LP_reserveds,LP_connects,LP_connecteds,LP_tradestatu
void LP_tradecommand_log(cJSON *argjson)
{
static FILE *logfp; char *jsonstr;
portable_mutex_lock(&LP_logmutex);
if ( logfp == 0 )
{
if ( (logfp= fopen(LP_STATSLOG_FNAME,"rb+")) != 0 )
@ -43,6 +44,7 @@ void LP_tradecommand_log(cJSON *argjson)
free(jsonstr);
fflush(logfp);
}
portable_mutex_unlock(&LP_logmutex);
}
void LP_statslog_parseline(cJSON *lineobj)

Loading…
Cancel
Save