init batontxid
added checks for rpc
This commit is contained in:
@@ -1348,7 +1348,8 @@ UniValue pricesbet(const UniValue& params, bool fHelp)
|
||||
UniValue pricesaddfunding(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 2)
|
||||
throw runtime_error("pricesaddfunding bettxid amount\n");
|
||||
throw runtime_error("pricesaddfunding bettxid amount\n"
|
||||
"where amount is in satoshis\n");
|
||||
LOCK(cs_main);
|
||||
UniValue ret(UniValue::VOBJ);
|
||||
|
||||
@@ -1357,7 +1358,12 @@ UniValue pricesaddfunding(const UniValue& params, bool fHelp)
|
||||
|
||||
CAmount txfee = 10000;
|
||||
uint256 bettxid = Parseuint256(params[0].get_str().c_str());
|
||||
if( bettxid.IsNull() )
|
||||
throw runtime_error("invalid bettxid\n");
|
||||
|
||||
CAmount amount = atoll(params[1].get_str().c_str());
|
||||
if( amount <= 0 )
|
||||
throw runtime_error("invalid amount\n");
|
||||
|
||||
return PricesAddFunding(txfee, bettxid, amount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user