Browse Source

Test

etomic
jl777 8 years ago
parent
commit
70ccddc376
  1. 15
      iguana/exchanges/DEXstats.h
  2. 4
      iguana/exchanges/stats.c

15
iguana/exchanges/DEXstats.h

@ -840,7 +840,7 @@ char *stats_prices(char *symbol,char *dest,struct DEXstats_disp *prices,int32_t
{
splinevals[n] = (prices[i].pricesum / prices[i].volumesum);
utc32[n] = tmp;
printf("offset.%d splineval %.8f t%u n.%d\n",i,splinevals[n],tmp,n);
//printf("offset.%d splineval %.8f t%u n.%d\n",i,splinevals[n],tmp,n);
n++;
}
}
@ -907,7 +907,18 @@ char *stats_JSON(cJSON *argjson,char *remoteaddr,uint16_t port)
return(clonestr("{\"error\":\"need method in request\"}"));
if ( (agent= jstr(argjson,"agent")) == 0 )
agent = "stats";
/*timestamp = (uint32_t)time(NULL);
leftdatenum = OS_conv_unixtime(&T,&seconds,timestamp - 1024*3600);
printf("%u: leftdatenum.%d %s\n",timestamp,leftdatenum,filestr);
memset(prices,0,sizeof(prices));
if ( (retstr= stats_prices("KMD","BTC",prices,leftdatenum,1024/24+1)) != 0 )
{
printf("%s\n",retstr);
free(retstr);
}
char *stats_prices(char *symbol,char *dest,struct DEXstats_disp *prices,int32_t leftdatenum,int32_t numdates)
*/
return(clonestr(jprint(argjson,0)));
}

4
iguana/exchanges/stats.c

@ -1003,11 +1003,11 @@ int main(int argc, const char * argv[])
{
timestamp = (uint32_t)time(NULL);
leftdatenum = OS_conv_unixtime(&T,&seconds,timestamp - 1024*3600);
printf("%u: leftdatenum.%d %s\n",timestamp,leftdatenum,filestr);
//printf("%u: leftdatenum.%d %s\n",timestamp,leftdatenum,filestr);
memset(prices,0,sizeof(prices));
if ( (retstr= stats_prices("KMD","BTC",prices,leftdatenum,1024/24+1)) != 0 )
{
printf("%s\n",retstr);
//printf("%s\n",retstr);
free(retstr);
}
if ( (fp= fopen(STATS_DEST,"wb")) != 0 )

Loading…
Cancel
Save