From 0ba4331ceabe77bba24a95b68b34118cf86a95f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 10 Apr 2019 20:53:00 -1100 Subject: [PATCH] Make fp for each file --- src/komodo_gateway.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 2098d30c2..5ac8ea540 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1549,10 +1549,11 @@ void komodo_passport_iteration() } extern std::vector Mineropret; // opreturn data set by the data gathering code -#define PRICES_MAXCHANGE (COIN / 100) // maximum acceptable change, set at 1% +#define PRICES_ERRORRATE (COIN / 100) // maximum acceptable change, set at 1% #define PRICES_SIZEBIT0 (sizeof(uint32_t) * 4) // 4 uint32_t unixtimestamp, BTCUSD, BTCGBP and BTCEUR #define KOMODO_LOCALPRICE_CACHESIZE 13 #define KOMODO_MAXPRICES 2048 +#define PRICES_SMOOTHWIDTH 1 #define issue_curl(cmdstr) bitcoind_RPC(0,(char *)"CBCOINBASE",cmdstr,0,0,0) @@ -1696,10 +1697,10 @@ CScript komodo_mineropret(int32_t nHeight) { memcpy(pricebits,Mineropret.data(),Mineropret.size()); memset(maxflags,0,sizeof(maxflags)); - if ( komodo_pricecmp(0,n,maxflags,pricebits,prevbits,PRICES_MAXCHANGE) < 0 ) + if ( komodo_pricecmp(0,n,maxflags,pricebits,prevbits,PRICES_ERRORRATE) < 0 ) { // if the new prices are outside tolerance, update Mineropret with clamped prices - komodo_priceclamp(n,pricebits,prevbits,PRICES_MAXCHANGE); + komodo_priceclamp(n,pricebits,prevbits,PRICES_ERRORRATE); //fprintf(stderr,"update Mineropret to clamped prices\n"); memcpy(Mineropret.data(),pricebits,Mineropret.size()); } @@ -1788,7 +1789,7 @@ int32_t komodo_opretvalidate(const CBlock *block,CBlockIndex * const previndex,i if ( pricebits[i] == 0 ) pricebits[i] = prevbits[i]; } - if ( komodo_pricecmp(nHeight,n,maxflags,pricebits,prevbits,PRICES_MAXCHANGE) < 0 ) + if ( komodo_pricecmp(nHeight,n,maxflags,pricebits,prevbits,PRICES_ERRORRATE) < 0 ) { for (i=1; i