From f8070af4733ac45fe8c88c3ebb1ac9438599dbed Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 2 Apr 2019 05:00:31 -1100 Subject: [PATCH] Anchor to latest --- src/komodo_gateway.h | 7 ++++--- src/rpc/blockchain.cpp | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index d4b629f0d..e7186ccc3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -2233,7 +2233,7 @@ char *komodo_pricename(char *name,int32_t ind) int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int32_t daywindow,uint32_t *rawprices2) { - int32_t i,j,k,n,iter,correlation,maxcorrelation=0; int64_t price,sum,den,mult,refprice,lowprice,highprice; + int32_t i,j,k,n,iter,correlation,maxcorrelation=0; int64_t firstprice,price,sum,den,mult,refprice,lowprice,highprice; if ( daywindow < 2 ) return(-1); if ( ind < 36 ) @@ -2287,12 +2287,13 @@ int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int if ( n != correlation ) return(-1); sum = den = n = 0; + firstprice = rawprices2[0]; for (i=0; i> 1); n++; } } @@ -2337,7 +2338,7 @@ int64_t komodo_pricesmoothed(int64_t *correlated,int32_t numprices) sum = den = 0; for (i=0; i> 1); den += (numprices - i); } smoothed = (sum / den); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index bc2e50fe4..2ff865f88 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1256,6 +1256,7 @@ UniValue prices(const UniValue& params, bool fHelp) item.push_back(Pair("prices",p)); } else item.push_back(Pair("name","error")); a.push_back(item); +break; } ret.push_back(Pair("pricefeeds",a)); ret.push_back(Pair("result","success"));