From 8e2cb38601b7ecd59d1c9ea537a860e18e8e91c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 3 May 2017 15:42:07 +0300 Subject: [PATCH] Test --- iguana/exchanges/stats.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 2833c92ec..7b4a473f9 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -52,12 +52,17 @@ void stats_kvjson(FILE *fp,int32_t height,int32_t savedheight,uint32_t timestamp { struct tai T; int32_t seconds,datenum; datenum = OS_conv_unixtime(&T,&seconds,timestamp); - jaddnum(kvjson,"key",key); + jaddstr(kvjson,"key",key); jaddnum(kvjson,"datenum",datenum); jaddnum(kvjson,"hour",seconds/3600); jaddnum(kvjson,"seconds",seconds % 3600); jaddnum(kvjson,"height",height); printf("(%s)\n",jprint(kvjson,0)); + if ( logfp != 0 ) + { + fprintf(logfp,"%s\n",jprint(kvjson,0)); + fflush(logfp); + } } void komodo_kvupdate(FILE *logfp,struct komodo_state *sp,int32_t ht,bits256 txid,int32_t vout,uint8_t *opretbuf,int32_t opretlen,uint64_t value) @@ -330,7 +335,7 @@ int main(int argc, const char * argv[]) if ( argc < 2 ) statefname = "/root/.komodo/KV/komodostate"; else statefname = (char *)argv[1]; - sprintf(logfname,"%s/logfile",DEST_DIR); + sprintf(logfname,"%s/logfile",STATS_DESTDIR); logfp = fopen(logfname,"wb"); printf("DEX stats running\n"); while ( 1 )