From fad3e01680f7e384da0a3546693be4c24bc4b58b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 2 Apr 2019 00:58:55 -1100 Subject: [PATCH] daywindow --- src/rpc/blockchain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 09c297ab9..bc8df8132 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1187,6 +1187,9 @@ UniValue prices(const UniValue& params, bool fHelp) throw runtime_error("prices maxsamples\n"); LOCK(cs_main); UniValue ret(UniValue::VOBJ); int64_t smoothed,*correlated; char name[64],*str; uint32_t rawprices[2048],*prices; uint32_t i,width,j,numpricefeeds=-1,n,nextheight,offset,ht,num=0,daywindow = (3600*24/ASSETCHAINS_BLOCKTIME) + 1; + if ( ASSETCHAINS_CBOPRET == 0 ) + throw JSONRPCError(RPC_INVALID_PARAMETER, "only -ac_cbopret chains have prices"); + int32_t maxsamples = atoi(params[0].get_str().c_str()); if ( maxsamples < 1 ) maxsamples = 1; @@ -1256,7 +1259,7 @@ UniValue prices(const UniValue& params, bool fHelp) ret.push_back(Pair("height",(int64_t)nextheight-1)); ret.push_back(Pair("maxsamples",(int64_t)maxsamples)); ret.push_back(Pair("width",(int64_t)width)); - ret.push_back(Pair("daywidth",(int64_t)daywidth)); + ret.push_back(Pair("daywindow",(int64_t)daywindow)); ret.push_back(Pair("numpricefeeds",(int64_t)numpricefeeds)); free(prices); free(correlated);