From 07e3b3e03f698b2c2f49ee02354df2dbc5d08013 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Dec 2017 16:50:33 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 7 ++++--- iguana/exchanges/LP_transaction.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 0f12bd976..4aa1578c8 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -42,6 +42,7 @@ struct LP_millistats char name[64]; } LP_psockloop_stats,LP_reserved_msgs_stats,utxosQ_loop_stats,command_rpcloop_stats,queue_loop_stats,prices_loop_stats,LP_coinsloop_stats,LP_coinsloopBTC_stats,LP_coinsloopKMD_stats,LP_pubkeysloop_stats,LP_swapsloop_stats,LP_gcloop_stats,LP_tradesloop_stats; extern int32_t IAMLP; +char LP_methodstr[64]; void LP_millistats_update(struct LP_millistats *mp) { @@ -78,7 +79,7 @@ void LP_millistats_update(struct LP_millistats *mp) if ( mp->threshold != 0. && elapsed > mp->threshold ) { //if ( IAMLP == 0 ) - printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count); + printf("%32s elapsed %10.2f millis > threshold %10.2f, ave %10.2f millis, count.%u %s\n",mp->name,elapsed,mp->threshold,mp->millisum/mp->count,mp->count,LP_methodstr); } mp->lastmilli = millis; } @@ -366,7 +367,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int //ptr = buf; methodstr[0] = 0; //printf("%s.(%s)\n",typestr,(char *)ptr); - if ( 0 ) + if ( 1 ) { cJSON *recvjson; char *mstr;//,*cstr; if ( (recvjson= cJSON_Parse((char *)ptr)) != 0 ) @@ -375,7 +376,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int { //printf("%s RECV.(%s)\n",typestr,(char *)ptr); } - safecopy(methodstr,jstr(recvjson,"method"),sizeof(methodstr)); + safecopy(LP_methodstr,jstr(recvjson,"method"),sizeof(LP_methodstr)); free_json(recvjson); } } diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 6a8117ac7..7afefdb9b 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1659,9 +1659,9 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t u txid = jbits256i(array,i); if ( (txobj= LP_gettx(symbol,txid,1)) != 0 ) { - //printf("txobj.(%s)\n",jprint(txobj,0)); if ( (vins= jarray(&m,txobj,"vin")) != 0 ) { + printf("vins.(%s)\n",jprint(vins,0)); if ( utxovout < m ) { vin = jitem(vins,utxovout); @@ -1669,7 +1669,7 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t u if ( bits256_cmp(vintxid,utxotxid) == 0 ) { LP_txdestaddr(destaddr,txid,0,txobj); - char str[65],str2[65],str3[65]; printf("LP_swap_spendtxid: in %s/v%d spends %s vs %s found.%d destaddr.(%s)\n",bits256_str(str,txid),utxovout,bits256_str(str2,vintxid),bits256_str(str3,utxotxid),bits256_cmp(vintxid,utxotxid) == 0,destaddr); + char str[65],str2[65],str3[65]; printf("LP_swap_spendtxid: found %s/v%d spends %s vs %s found.%d destaddr.(%s)\n",bits256_str(str,txid),utxovout,bits256_str(str2,vintxid),bits256_str(str3,utxotxid),bits256_cmp(vintxid,utxotxid) == 0,destaddr); spendtxid = txid; break; }