Browse Source

IGUANA_MAXRPCTHREADS

jl777
jl777 7 years ago
parent
commit
1ac4e67628
  1. 4
      iguana/exchanges/LP_prices.c
  2. 4
      iguana/exchanges/LP_utxo.c
  3. 4
      iguana/exchanges/stats.c

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

4
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<m; i++)
{
printf("%.8f ",dstr(LP_DEPOSITSATOSHIS(buf[i])));
//printf("%.8f ",dstr(LP_DEPOSITSATOSHIS(buf[i])));
if ( max >= 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
{

4
iguana/exchanges/stats.c

@ -24,6 +24,8 @@
#include <stdio.h>
#include <stdint.h>
#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 )

Loading…
Cancel
Save