Browse Source

#define PRICES_MAXDATAPOINTS 8

z_createrawtransaction
jl777 5 years ago
parent
commit
ece9e468bc
  1. 1
      src/komodo_defs.h
  2. 1
      src/komodo_gateway.h
  3. 9
      src/rpc/blockchain.cpp

1
src/komodo_defs.h

@ -85,6 +85,7 @@ void komodo_netevent(std::vector<uint8_t> payload);
#define KOMODO_KVDURATION 1440
#define KOMODO_KVBINARY 2
#define PRICES_SMOOTHWIDTH 1
#define PRICES_MAXDATAPOINTS 8
uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume);
int32_t komodo_paxprices(int32_t *heights,uint64_t *prices,int32_t max,char *base,char *rel);
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);

1
src/komodo_gateway.h

@ -1555,7 +1555,6 @@ extern std::vector<uint8_t> Mineropret; // opreturn data set by the data gatheri
#define KOMODO_LOCALPRICE_CACHESIZE 13
#define KOMODO_MAXPRICES 2048
#define PRICES_SMOOTHWIDTH 1
#define PRICES_MAXDATAPOINTS 8
#define issue_curl(cmdstr) bitcoind_RPC(0,(char *)"CBCOINBASE",cmdstr,0,0,0)

9
src/rpc/blockchain.cpp

@ -1255,7 +1255,14 @@ UniValue prices(const UniValue& params, bool fHelp)
rngval = (rngval*11109 + 13849);
if ( (correlated[i]= komodo_pricecorrelated(rngval,j,&prices[offset],1,0,PRICES_SMOOTHWIDTH)) < 0 )
throw JSONRPCError(RPC_INVALID_PARAMETER, "null correlated price");
{
int64_t checkprices[PRICES_MAXDATAPOINTS];
if ( komodo_priceget(checkprices,j,nextheight-1-i,1) >= 0 )
{
if ( checkprices[1] != correlated[i] )
fprintf(stderr,"ind.%d ht.%d %.8f != %.8f\n",j,nextheight-1-i,(double)checkprices[1]/COIN,(double)correlated[i]/COIN);
}
}
}
tmpbuf = (int64_t *)calloc(sizeof(int64_t),2*PRICES_DAYWINDOW);
for (i=0; i<maxsamples&&i<numsamples; i++)

Loading…
Cancel
Save