Browse Source

Test

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

4
iguana/exchanges/DEXstats.h

@ -737,15 +737,15 @@ void stats_updatedisp(struct DEXstats_disp *disp,int32_t seconds,double price,do
void stats_dispprices(struct DEXstats_disp *prices,int32_t leftdatenum,int32_t numdates,struct DEXstats_datenuminfo *date,char *dest,int32_t current_daysecond)
{
int32_t i,j,seconds,hour,offset,delta,datenum = date->datenum; struct DEXstats_pairinfo *pair; struct DEXstats_pricepoint *ptr; uint32_t timestamp;
printf("add datenum.%d vs leftdatenum.%d numdates.%d\n",datenum,leftdatenum,numdates);
if ( datenum >= leftdatenum-1 && datenum <= leftdatenum+numdates )
{
offset = datenum - leftdatenum;
printf("offset.%d\n",offset);
printf("add datenum.%d vs leftdatenum.%d numdates.%d offset.%d numpairs.%d\n",datenum,leftdatenum,numdates,offset,date->numpairs);
for (i=0; i<date->numpairs; i++)
if ( strcmp(dest,date->pairs[i].dest) == 0 )
{
pair = &date->pairs[i];
printf("found dest.(%s) numprices.%d\n",dest,pair->numprices);
for (j=0; j<pair->numprices; j++)
{
ptr = &pair->prices[j];

2
iguana/exchanges/stats.c

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

Loading…
Cancel
Save