From c6fca9511810429d79e49fd2ae194064b28c90e4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 31 Mar 2019 21:26:51 -1100 Subject: [PATCH] Fix strange data bug --- src/komodo_gateway.h | 17 ++++++----------- src/komodo_utils.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index c1e5dcdcb..d863c8a27 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1665,7 +1665,7 @@ CScript komodo_mineropret(int32_t nHeight) memcpy(pricebits,Mineropret.data(),Mineropret.size()); if ( komodo_pricecmp(0,n,&maxflag,pricebits,prevbits,PRICES_MAXCHANGE) < 0 ) { - // if the new prices are not within tolerance, update Mineropret with clipped prices + // if the new prices are outside tolerance, update Mineropret with clamped prices komodo_priceclamp(n,pricebits,prevbits,PRICES_MAXCHANGE); fprintf(stderr,"update Mineropret to clamped prices\n"); memcpy(Mineropret.data(),pricebits,Mineropret.size()); @@ -1722,17 +1722,10 @@ int32_t komodo_opretvalidate(int32_t nHeight,CScript scriptPubKey) for (i=1; i= PRICES_SIZEBIT0 ) { @@ -2030,6 +2023,8 @@ int32_t get_btcusd(uint32_t pricebits[4]) } // komodo_cbopretupdate() obtains the external price data and encodes it into Mineropret, which will then be used by the miner and validation +// save history, use new data to approve past rejection, where is the auto-reconsiderblock? +// 51% correlation, smoothing void komodo_cbopretupdate() { diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 44b1192a4..a91dae1e8 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2067,7 +2067,7 @@ void komodo_args(char *argv0) if ( ASSETCHAINS_CBOPRET != 0 ) { extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_CBOPRET),(void *)&ASSETCHAINS_CBOPRET); - //komodo_cbopretupdate(); // will set Mineropret + komodo_cbopretupdate(); // will set Mineropret fprintf(stderr,"This blockchain uses data produced from CoinDesk Bitcoin Price Index\n"); } }