From 5163692e2201406fded9c8dd5a44c12d193791e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 2 Apr 2019 00:55:09 -1100 Subject: [PATCH] Fix --- src/komodo_gateway.h | 21 +++++++++++++-------- src/rpc/blockchain.cpp | 36 ++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 021abbd60..450f42aeb 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -2213,18 +2213,23 @@ char *komodo_pricename(char *name,int32_t ind) return(0); } -int64_t komodo_timestampset(int64_t *correlatedp,uint32_t *rawtimestamps,int32_t numtimestamps) -{ - *correlatedp = rawtimestamps[0]; - return(*correlatedp); // really to do this would need to do it on a per pricefeed and which prices were used in the correlation, but that is a lot of extra work for a field which is not critical -} - int64_t komodo_pricesmoothed(int64_t *correlated,int32_t numprices) { - return(0); + int32_t i; + for (i=0; i2*daywindow+2; i++,ht--) { if ( ht < 0 || ht > chainActive.Height() ) @@ -1207,9 +1208,7 @@ UniValue prices(const UniValue& params, bool fHelp) { if ( (n= komodo_heightpricebits(rawprices,ht)) > 0 ) { - if ( firstn == -1 ) - firstn = n; - else if ( n != firstn ) + if ( n != numpricefeeds ) throw JSONRPCError(RPC_INVALID_PARAMETER, "numprices != first numprices"); else { @@ -1222,15 +1221,12 @@ UniValue prices(const UniValue& params, bool fHelp) for (i=0; i