From c5a41e2cc100941e6d938b817735f5e8862d2050 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Nov 2017 13:48:00 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_nativeDEX.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 72c64d04b..c9ef8b70b 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -36,6 +36,7 @@ char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *r { char *method,*userpass,*base,*rel,*coin,*retstr = 0; int32_t changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); + printf("stats_JSON %s\n",method); /*if ( (ipaddr= jstr(argjson,"ipaddr")) != 0 && (argport= juint(argjson,"port")) != 0 && (method == 0 || strcmp(method,"electrum") != 0) ) { if ( strcmp(ipaddr,"127.0.0.1") != 0 && argport >= 1000 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index b63b8ecb9..3af21780f 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -768,7 +768,7 @@ void LP_pubkeysloop(void *ctx) } if ( time(NULL) > lasttime+LP_ORDERBOOK_DURATION*0.5 ) { - //printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); +printf("LP_pubkeysloop %u\n",(uint32_t)time(NULL)); LP_notify_pubkeys(ctx,LP_mypubsock); lasttime = (uint32_t)time(NULL); } @@ -785,7 +785,7 @@ void LP_privkeysloop(void *ctx) { LP_millistats_update(&LP_privkeysloop_stats); LP_counter += 1000; - //printf("LP_privkeysloop %u\n",LP_counter); +printf("LP_privkeysloop %u\n",LP_counter); LP_privkey_updates(ctx,LP_mypubsock,0); sleep(LP_ORDERBOOK_DURATION * .777); } @@ -801,10 +801,9 @@ void LP_swapsloop(void *ignore) { LP_millistats_update(&LP_swapsloop_stats); LP_counter += 10000; - //printf("LP_swapsloop %u\n",LP_counter); +printf("LP_swapsloop %u\n",LP_counter); if ( (retstr= basilisk_swapentry(0,0)) != 0 ) free(retstr); - //LP_millistats_update(0); sleep(600); } } @@ -837,14 +836,14 @@ void LP_reserved_msgs(void *ignore) if ( num_Reserved_msgs[1] > 0 ) { num_Reserved_msgs[1]--; - //printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); +printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); Reserved_msgs[1][num_Reserved_msgs[1]] = 0; } else if ( num_Reserved_msgs[0] > 0 ) { num_Reserved_msgs[0]--; - //printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); +printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); Reserved_msgs[0][num_Reserved_msgs[0]] = 0; } @@ -1227,14 +1226,14 @@ void LP_free(void *ptr) static uint32_t lasttime,unknown; //free(ptr); return; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = lagging = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp) { total += mp->len; n++; - if ( now > mp->timestamp+120 ) + if ( 0 && now > mp->timestamp+120 ) { lagging++; if ( now > mp->timestamp+240 )