From 1ac4e67628c991220d5c7dae61e91bddc73cd625 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Apr 2018 10:44:08 +0300 Subject: [PATCH] IGUANA_MAXRPCTHREADS --- iguana/exchanges/LP_prices.c | 4 ++-- iguana/exchanges/LP_utxo.c | 4 ++-- iguana/exchanges/stats.c | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index dd7c9ab11..6bb9c3484 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -114,7 +114,7 @@ void LP_pubkey_update(struct LP_pubkey_info *pubp,uint32_t baseind,uint32_t reli DL_APPEND(pubp->quotes,pq); // already serialized as only path is via stats_JSON() //printf("create pubp quotes %d/%d\n",baseind,relind); } -printf("%d/%d price %.8f balance %.8f %s num.%d min %.8f max %.8f\n",baseind,relind,price,dstr(balance),utxocoin,numutxos,dstr(minutxo),dstr(maxutxo)); +//printf("%d/%d price %.8f balance %.8f %s num.%d min %.8f max %.8f\n",baseind,relind,price,dstr(balance),utxocoin,numutxos,dstr(minutxo),dstr(maxutxo)); pq->price = price; if ( utxocoin != 0 && utxocoin[0] != 0 ) { @@ -1169,7 +1169,7 @@ cJSON *LP_pricearray(char *base,char *rel,uint32_t firsttime,uint32_t lasttime,i void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,char *utxocoin,int32_t numrelutxos,int64_t balance,int64_t minutxo,int64_t maxutxo,int64_t unconfcredits) { struct LP_priceinfo *basepp,*relpp; uint32_t now; int64_t price64; struct LP_pubkey_info *pubp; char str[65],fname[512]; FILE *fp; -printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s balance %.8f min %.8f max %.8f\n",base,rel,price,bits256_str(str,pubkey),dstr(balance),dstr(minutxo),dstr(maxutxo)); +//printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s balance %.8f min %.8f max %.8f\n",base,rel,price,bits256_str(str,pubkey),dstr(balance),dstr(minutxo),dstr(maxutxo)); if ( LP_pricevalid(price) > 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { //if ( (fp= basepp->fps[relpp->ind]) == 0 ) diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 3e2cf89fc..05274d9f6 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -329,7 +329,7 @@ int32_t LP_address_minmax(int32_t iambob,uint64_t *medianp,uint64_t *minp,uint64 { for (i=1; i= LP_DEPOSITSATOSHIS(buf[i]) ) { *maxp = buf[i]; @@ -339,7 +339,7 @@ int32_t LP_address_minmax(int32_t iambob,uint64_t *medianp,uint64_t *minp,uint64 } } } else printf("sort error? max %.8f != %.8f\n",dstr(max),dstr(buf[0])); - printf("vs. max %.8f %s maxp %.8f median %.8f\n",dstr(max),coin->symbol,dstr(*maxp),dstr(*medianp)); + //printf("vs. max %.8f %s maxp %.8f median %.8f\n",dstr(max),coin->symbol,dstr(*maxp),dstr(*medianp)); } else { diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 8ed1e620f..c91bbb145 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -24,6 +24,8 @@ #include #include #include "../../crypto777/OS_portable.h" +#define IGUANA_MAXRPCTHREADS 1 + #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define STATS_DESTDIR "/var/www/html" #define STATS_DEST "/var/www/html/DEXstats.json" @@ -855,7 +857,7 @@ void stats_rpcloop(void *args) req->sock = sock; req->ipbits = ipbits; req->port = port; - if ( spawned > 0 ) + if ( spawned >= (IGUANA_MAXRPCTHREADS-1) ) LP_rpc_processreq(req); // this might lead to "cant open file errors" else if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 )