Browse Source

Test

etomic
jl777 7 years ago
parent
commit
c5a41e2cc1
  1. 1
      iguana/exchanges/LP_commands.c
  2. 15
      iguana/exchanges/LP_nativeDEX.c

1
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 )

15
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 )

Loading…
Cancel
Save