diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 38777e672..8cb91e539 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -212,7 +212,7 @@ int32_t prices_syntheticvec(std::vector &vec,std::vector opcode = PRICES_MMM, need = 3; else if ( opstr == "///" ) opcode = PRICES_DDD, need = 3; - else if ( (ind= komodo_priceind(opstr.c_str())) >= 0 ) + else if ( (ind= komodo_priceind((char *)opstr.c_str())) >= 0 ) opcode = ind, need = 0; else if ( (weight= atoi(opstr.c_str())) > 0 && weight < KOMODO_MAXPRICES ) { @@ -256,8 +256,8 @@ int64_t prices_syntheticprice(std::vector vec,int32_t height,int32_t m else { if ( leverage > 0 ) - pricestack[depth] = MAX(pricedata[1],pricedata[2]); - else pricestack[depth] = MIN(pricedata[1],pricedata[2]); + pricestack[depth] = (pricedata[1] > pricedata[2]) ? pricedata[1] : pricedata[2]; // MAX + else pricestack[depth] = (pricedata[1] < pricedata[2]) ? pricedata[1] : pricedata[2]; // MIN } } if ( pricestack[depth] == 0 ) @@ -389,7 +389,7 @@ int64_t prices_costbasis(CTransaction bettx) return(costbasis); } -int64_t prices_batontxid(uint256 &batontxid,CTransaction bettx,uint256 bettxid); +int64_t prices_batontxid(uint256 &batontxid,CTransaction bettx,uint256 bettxid) { int64_t addedbets = 0; // iterate through batons, adding up vout1 -> addedbets @@ -437,7 +437,7 @@ UniValue PricesAddFunding(uint64_t txfee,uint256 bettxid,int64_t amount) { int32_t nextheight = komodo_nextheight(); CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(),nextheight); UniValue result(UniValue::VOBJ); - struct CCcontract_info *cp,C; CPubKey pricespk,mypk; int64_t addedbets=0,betamount,firstprice; std::vector vec; uint256 batontxid; std::string rawtx; char myaddr[64]; + struct CCcontract_info *cp,C; CTransaction bettx; CPubKey pricespk,mypk; int64_t addedbets=0,betamount,firstprice; std::vector vec; uint256 batontxid; std::string rawtx; char myaddr[64]; cp = CCinit(&C,EVAL_PRICES); if ( txfee == 0 ) txfee = PRICES_TXFEE; @@ -484,7 +484,7 @@ UniValue PricesSetcostbasis(uint64_t txfee,uint256 bettxid) mtx.vin.push_back(CTxIn(bettxid,1,CScript())); for (i=0; i