pricesinfo height opt

This commit is contained in:
dimxy
2019-04-16 00:19:10 +05:00
parent e4de8aca2d
commit 59fbfbcae7
2 changed files with 19 additions and 4 deletions

View File

@@ -6931,13 +6931,15 @@ UniValue priceslist(const UniValue& params, bool fHelp)
UniValue pricesinfo(const UniValue& params, bool fHelp)
{
uint256 bettxid; int32_t height;
if ( fHelp || params.size() != 2 )
throw runtime_error("pricesinfo fundingtxid height\n");
if ( fHelp || params.size() != 1 && params.size() != 2)
throw runtime_error("pricesinfo fundingtxid [height]\n");
if ( ensure_CCrequirements(EVAL_PRICES) < 0 )
throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n");
bettxid = Parseuint256((char *)params[0].get_str().c_str());
height = atoi(params[1].get_str().c_str());
return(PricesInfo(bettxid,height));
height = 0;
if (params.size() == 2)
height = atoi(params[1].get_str().c_str());
return(PricesInfo(bettxid, height));
}
UniValue dicefund(const UniValue& params, bool fHelp)