From efec12bcf532b38c917f1ea504d97ea4bac2ab9b Mon Sep 17 00:00:00 2001 From: dimxy Date: Sun, 21 Apr 2019 21:01:02 +0500 Subject: [PATCH] if TESTMODE PRICES_DAYWINDOW=3 --- src/cc/CCPrices.h | 3 ++- src/cc/prices.cpp | 3 +++ src/komodo_defs.h | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cc/CCPrices.h b/src/cc/CCPrices.h index 1402a995c..0225ff69b 100644 --- a/src/cc/CCPrices.h +++ b/src/cc/CCPrices.h @@ -17,10 +17,11 @@ #ifndef CC_PRICES_H #define CC_PRICES_H +#include "komodo_defs.h" #include "CCinclude.h" int32_t komodo_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks); -#define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) +// #define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) // defined in komodo_defs.h #define PRICES_TXFEE 10000 #define PRICES_MAXLEVERAGE 777 #define PRICES_SMOOTHWIDTH 1 diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index c302e6d73..d8944df9f 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -1102,6 +1102,9 @@ UniValue PricesInfo(uint256 bettxid, int32_t refheight) result.push_back(Pair("costbasistxid", costbasistxid.GetHex())); prices_betjson(result, profits, costbasis, positionsize, addedbets, leverage, firstheight, firstprice, lastprice, equity); result.push_back(Pair("height", (int64_t)refheight)); +#ifdef TESTMODE + result.push_back(Pair("test_daywindow", PRICES_DAYWINDOW)); +#endif return(result); } } diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 2fcd29df3..d5a9a21e2 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -38,7 +38,12 @@ #define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) #define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000001*COIN) + +#ifndef TESTMODE #define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) +#else +#define PRICES_DAYWINDOW (3) +#endif extern uint8_t ASSETCHAINS_TXPOW,ASSETCHAINS_PUBLIC; int32_t MAX_BLOCK_SIZE(int32_t height);