From 4f478650b89d1a22aa1760a8bc971454859833d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 11 Apr 2019 03:46:04 -1100 Subject: [PATCH] +print --- src/komodo_gateway.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a3d3628b3..86ab82583 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -2356,6 +2356,9 @@ int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int mult = PriceMult[ind]; if ( nonzprices != 0 ) memset(nonzprices,0,sizeof(*nonzprices)*PRICES_DAYWINDOW); + for (i=0; i width ) + if ( height > PRICES_DAYWINDOW ) { fseek(PRICES[0].fp,(height-width+1) * numprices * sizeof(uint32_t),SEEK_SET); if ( fread(ptr32,sizeof(uint32_t),width*numprices,PRICES[0].fp) == width*numprices ) @@ -2612,7 +2615,7 @@ void komodo_pricesupdate(int32_t height,CBlock *pblock) memcpy(&buf[2],&correlated,sizeof(correlated)); if ( fwrite(buf,1,sizeof(buf),PRICES[ind].fp) != sizeof(buf) ) fprintf(stderr,"error fwrite buf for ht.%d ind.%d\n",height,ind); - else + else if ( height > PRICES_DAYWINDOW*2 ) { fseek(PRICES[ind].fp,(height-PRICES_DAYWINDOW+1) * 3 * sizeof(int64_t),SEEK_SET); if ( fread(ptr64,sizeof(int64_t),PRICES_DAYWINDOW*3,PRICES[ind].fp) == PRICES_DAYWINDOW*3 )