From 35e651d006272136ee3a75d1d0eae97906d246fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 22 Oct 2017 13:41:02 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 18 +++++++++--------- iguana/exchanges/LP_signatures.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0f4722c58..af0374ab7 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -117,7 +117,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson char *retstr=0; if ( jobj(argjson,"result") != 0 || jobj(argjson,"error") != 0 ) return(0); - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",0)) != 0 ) @@ -127,8 +127,8 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson //LP_send(pubsock,retstr,(int32_t)strlen(retstr)+1,0); } } //else printf("finished tradecommand (%s)\n",jprint(argjson,0)); - if ( OS_milliseconds()-millis > 100 ) - printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); + //if ( OS_milliseconds()-millis > 100 ) + // printf("%.3f %s\n",OS_milliseconds()-millis,jprint(argjson,0)); return(retstr); } @@ -159,7 +159,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { static uint32_t dup,uniq; int32_t i,len,cipherlen,datalen=0,duplicate=0,encrypted=0; char *method,*method2,*tmp,*cipherstr,*retstr=0,*jsonstr=0; cJSON *argjson; uint32_t crc32; - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); crc32 = calc_crc32(0,&ptr[2],recvlen-2); if ( (crc32 & 0xff) == ptr[0] && ((crc32>>8) & 0xff) == ptr[1] ) encrypted = 1; @@ -224,7 +224,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock, { } portable_mutex_unlock(&LP_commandmutex); - printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); + //printf("%.3f %s LP_command_process\n",OS_milliseconds()-millis,jstr(argjson,"method")); free_json(argjson); } } @@ -268,7 +268,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int if ( LP_lastcommand != 0 ) free(LP_lastcommand); LP_lastcommand = clonestr((char *)ptr); - double millis = OS_milliseconds(); + //double millis = OS_milliseconds(); if ( (retstr= LP_process_message(ctx,typestr,myipaddr,pubsock,ptr,recvlen,sock)) != 0 ) free(retstr); if ( Broadcaststr != 0 ) @@ -294,7 +294,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int } free(str); } - printf("%.3f LP_process_message %s\n",OS_milliseconds()-millis,methodstr); + //printf("%.3f LP_process_message %s\n",OS_milliseconds()-millis,methodstr); } } } @@ -322,7 +322,7 @@ int32_t LP_nanomsg_recvs(void *ctx) //printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock); milli = OS_milliseconds(); nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1); - if ( OS_milliseconds()-milli > 100 ) + if ( OS_milliseconds()-milli > 3 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } /*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht @@ -336,7 +336,7 @@ int32_t LP_nanomsg_recvs(void *ctx) { milli = OS_milliseconds(); nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1); - if ( OS_milliseconds()-milli > 100 ) + if ( OS_milliseconds()-milli > 3 ) fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",OS_milliseconds()-milli,LP_lastcommand!=0?LP_lastcommand:""); } //portable_mutex_unlock(&LP_nanorecvsmutex); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index b09e548fb..823698676 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -277,7 +277,7 @@ int32_t LP_utxosQ_process() struct LP_utxos_qitem *uitem; int32_t n; char *symbol,*coinaddr; struct LP_address *ap; struct iguana_info *coin; cJSON *array; if ( (uitem= queue_dequeue(&utxosQ)) != 0 ) { - printf("LP_utxosQ_process.(%s)\n",jprint(uitem->argjson,0)); + //printf("LP_utxosQ_process.(%s)\n",jprint(uitem->argjson,0)); if ( (coinaddr= jstr(uitem->argjson,"coinaddr")) != 0 && (symbol= jstr(uitem->argjson,"coin")) != 0 && (coin= LP_coinfind(symbol)) != 0 ) // addsig { if ( coin->electrum == 0 || (ap= LP_addressfind(coin,coinaddr)) != 0 )