Browse Source

Test

etomic
jl777 8 years ago
parent
commit
8d07874da4
  1. 3
      iguana/exchanges/DEXstats.h
  2. 4
      iguana/exchanges/stats.c

3
iguana/exchanges/DEXstats.h

@ -151,7 +151,7 @@ void stats_LPpubkeyupdate(char *LPpubkey,uint32_t timestamp)
void stats_priceupdate(int32_t datenum,int32_t hour,int32_t seconds,uint32_t timestamp,int32_t height,char *key,char *LPpubkey,cJSON *tradejson) void stats_priceupdate(int32_t datenum,int32_t hour,int32_t seconds,uint32_t timestamp,int32_t height,char *key,char *LPpubkey,cJSON *tradejson)
{ {
uint64_t srcamount,destamount; char *source,*dest; double price; struct DEXstats_priceinfo *pp; int32_t dir = 0; uint64_t srcamount,destamount; char *source,*dest; double price; struct DEXstats_priceinfo *pp;
if ( LPpubkey != 0 ) if ( LPpubkey != 0 )
stats_LPpubkeyupdate(LPpubkey,timestamp); stats_LPpubkeyupdate(LPpubkey,timestamp);
if ( tradejson != 0 ) if ( tradejson != 0 )
@ -165,6 +165,7 @@ void stats_priceupdate(int32_t datenum,int32_t hour,int32_t seconds,uint32_t tim
price = (double)destamount / srcamount; price = (double)destamount / srcamount;
if ( key != 0 ) if ( key != 0 )
{ {
dir = 1;
if ( (pp= stats_priceinfo(source,datenum)) != 0 ) if ( (pp= stats_priceinfo(source,datenum)) != 0 )
stats_datenumupdate(-1,pp,datenum,hour,seconds,height,dstr(srcamount),dest,price); stats_datenumupdate(-1,pp,datenum,hour,seconds,height,dstr(srcamount),dest,price);
if ( (pp= stats_priceinfo(dest,datenum)) != 0 ) if ( (pp= stats_priceinfo(dest,datenum)) != 0 )

4
iguana/exchanges/stats.c

@ -832,9 +832,9 @@ void stats_pricefeed(struct komodo_state *sp,char *symbol,int32_t ht,uint32_t *p
//printf("(%s)\n",jprint(kvjson,0)); //printf("(%s)\n",jprint(kvjson,0));
argjson = cJSON_CreateArray(); argjson = cJSON_CreateArray();
jaddistr(argjson,"KMD"); jaddistr(argjson,"KMD");
jaddnum(argjson,1); jaddinum(argjson,1);
jaddistr(argjson,"BTC"); jaddistr(argjson,"BTC");
jaddnum(argjson,dstr(pvals[32]) / 1000.); jaddinum(argjson,dstr(pvals[32]) / 1000.);
stats_priceupdate(datenum,seconds/3600,seconds % 3600,sp->SAVEDTIMESTAMP,sp->SAVEDHEIGHT,0,0,argjson); stats_priceupdate(datenum,seconds/3600,seconds % 3600,sp->SAVEDTIMESTAMP,sp->SAVEDHEIGHT,0,0,argjson);
free_json(argjson); free_json(argjson);
} }

Loading…
Cancel
Save